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

1.The questions have given an array declaration and move operation then this statement is correct or not?

3 Answers   TCS,


parameters cannot be passed in which one??

2 Answers   CTS,


Hi, I am getting the error in RPG (All Record Formats for externally-described file ABCD ignored or dropped due to error; file ignored.) Please suggest any

2 Answers   Satyam,


What does Implicit Open means with respect to a file ? What about the Explicit Open?..what are the major differences between these two?

1 Answers   IBM,


can I touch the array during treatments?

0 Answers   IBM,






can you debug ile rpg program using isdb?

0 Answers   IBM,


what procedure should we use to find whether the following operations are successful or not setll setgt chain read reade readp pls tell with example i'm not lazy to read the manual or not lazy to do anything.but sometimes i cannot understand the things given in manual in high level english its little bit complicated for me,i can't understand their way of writing thats why i ask these questions here and find the solution in simple words that i can understand thats the real reason sir.sorry if i had hurt you or disturbed you.please understand my situation.

5 Answers   iGate,


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

0 Answers  


I have to change a program. This program is calling a subroutine mor than 100times within it. so will it have any performance issue? if yes than what changes i can make. Thanx for ur valuable answer.

2 Answers  


Explain mdt?

0 Answers  


check existence of one record without using chain or read?

1 Answers   IBM,


If the last record of a file has been read, and the next operation on that file is a READ operation, what will be the values of the input fields for that file? A. They will be blank and/or zero. B. They will be null. C. They will equal the values of the first record in the file. D. They will equal the values of the last record read.

3 Answers  


Categories