Last statement of any RPG pgm is LR?

Answers were Sorted based on User's Feedback



Last statement of any RPG pgm is LR?..

Answer / amit

Not necessary. We can write the codes after SETON LR also
and it will execute that too. The main difference is that
the program will end after the last line of coding you did
and will clear all the access path and variables to blanks
or zeros.
But when you give RETURN then the program will not execute
the below coding part and will end as soon as the RETURN is
encountered,but here it will not clear the access path and
the variables..if you run the program again you will find
the last value in the variable.

hope this will help

Is This Answer Correct ?    13 Yes 0 No

Last statement of any RPG pgm is LR?..

Answer / amit

Not necessarily. LR is generally set on after all
processing is doen i.e. at the end of the program but there
is no hard and fast rule for that.

Is This Answer Correct ?    7 Yes 1 No

Last statement of any RPG pgm is LR?..

Answer / sivakumar y

While writing a program Last statement of RPG program need
not be LR. It is the last executable statement. i.e. after
all processing is done LR(Last Record indicator) will be
set on.

NOTE: In a program that does not contain a primary file,
you can set the LR indicator on as one method to end the
program.

Is This Answer Correct ?    4 Yes 1 No

Last statement of any RPG pgm is LR?..

Answer / vishal

Not necessary . In case of RPG cycle where primary file is defined, it does not require any LR statement or RETURN opcode. if there is any total calculations in output spec then that is performed at last using L0 indicator.

Is This Answer Correct ?    1 Yes 0 No

Last statement of any RPG pgm is LR?..

Answer / syam

No, Last statement is RETURN. Means Exit from program
LR is second last statment. Means move pointer to end of
file.

Ex: CLOS BEGSR
MOVE '1' *INLR
RETURN
ENDSR

Is This Answer Correct ?    4 Yes 9 No

Post New Answer

More DB400 Interview Questions

What is the difference between access path and open data path?

0 Answers  


How to update physical file using logical file with example?

0 Answers  


Is it possible to create a logical file whose Physical file is not in same library?

6 Answers  


How to change the batch job to interactive job?

0 Answers  


Last statement of any rpg program is lr?

0 Answers  






Last statement of any RPG pgm is LR?

5 Answers  


I have a pf, it contains 5 members, how to access particular member data from logical file?

0 Answers  


what is use of self join and which cases you will use this join

1 Answers   TCS,


Where the QTEMP library will get created? if the the answer is QSYS, then howcome more than one job can create same library name(QTEMP) in QSYS? what is the uniqueness of QTEMP? For example, run the below command in different workstation WRKOBJ QSYS/QTEMP And take 8 in the option to check the description. both will have different info. so where(which LIB) exactly the QTEMP is stored?

2 Answers  


wirte a simple program for read file in cl

2 Answers   Active Brains,


Can anybody tell why Journalling is compulsary before Commitment Control?

2 Answers  


how to update physical files using normal logical file

4 Answers  


Categories