1.Are there any errors in the following statement?If so
then list them.DTAARA is a data area having a field EMP #
and EMPNO is a
field in the file EMPPF.Which has one record.
READ EMPPF
IF %FOUND(EMPPF)
IN DTAARA
EVAL EMP#=EMPNO
OUT DTAARA
ENDIF

Answers were Sorted based on User's Feedback



1.Are there any errors in the following statement?If so then list them.DTAARA is a data area havin..

Answer / amitava

First of all, %found() function is not set after the READ
operation. If not %eof() can be used instead.

Is This Answer Correct ?    8 Yes 3 No

1.Are there any errors in the following statement?If so then list them.DTAARA is a data area havin..

Answer / abhishek

I think before updating data area it should be Locked too
to make sure no other program is trying to update same data
area.

READ EMPPF
IF %FOUND(EMPPF)
*LOCK IN DTAARA
EVAL EMP#=EMPNO
OUT DTAARA
ENDIF

Is This Answer Correct ?    3 Yes 0 No

1.Are there any errors in the following statement?If so then list them.DTAARA is a data area havin..

Answer / gagandeep kaur

%found is always used with Chain opcode

Is This Answer Correct ?    3 Yes 1 No

1.Are there any errors in the following statement?If so then list them.DTAARA is a data area havin..

Answer / syam

IN *DTAARA

OUT *DTAARA

Is This Answer Correct ?    1 Yes 0 No

1.Are there any errors in the following statement?If so then list them.DTAARA is a data area havin..

Answer / abhishek

Sorry forgot to put * before data area.

READ EMPPF
IF %FOUND(EMPPF)
*LOCK IN *DTAARA
EVAL EMP#=EMPNO
OUT *DTAARA
ENDIF

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More RPG400 Interview Questions

HOW DO YOU DISPLAY A DISPLAYFILE AT OTHER WORKSTATION? CAN WE MOVE A PHYSICAL FILE? WITHOUT MOVING A FILE?

2 Answers  


I need to generate outfile for object of all the user lib. in the sysmte using cmd DSPOBJD. But this cmd is correcpted in my server,Any body tell me is there any alternative...?

2 Answers  


Are all these RPG/400 Interviewed Questions being asked recently? are current?

1 Answers  


Suppose we have 10 records with same name and we are reading using READE,after 4 record i have to use CHAIN what is the output

3 Answers  


1.what are the ARITHMETIC EXPRESSIONS IN CL PGM? 2.How to PASSING PARAMETER TO CL PGM?

1 Answers   NetCracker,


what is file information data structure?

1 Answers   IBM,


what is plat file?

6 Answers   Indian Infotech,


Suppose i am having 3 programs PgmA,pgmB,pgmC and using source debugger. At debugging time i found that pgmC having some code error..then in debug mode directly how can i debug pgmC

2 Answers  


How to create a key field for a logical file inside RPG?

4 Answers   HSBC,


How do I read records from Subfile? what is the purpose of READC explain with example?

4 Answers   IBM,


how do u find whether a record is locked or not??/

5 Answers   CTS,


3. Given the DOS Specification below and the following information: • Indicator 50 is off • No records have been written to the subfile What will be the result if the EXFMT operation code is performed on the record format CTLR? A R SUBFL A DESCRIP 101 6 1ODSPATR(UL) A DFT(’NOT FOUND’) A R CTLR SFLCTL(SUBFL) A N50 SFLDSP A SFLDSPCTL A SFLINZ A 67 SFIJEND A SFLSIZ(13) A SFLPAG(12) A ACCOUNTNO 100 S 10 a.) Only AccountNo will display b.) SUBFL will be initialized with 13 blank records c.) An I/O exception error will occur d.) The screen will display 12 records with ‘NOT FOUND’

4 Answers   IBM,


Categories