What will happen if we r using seton lr after return or vice
versa.
Answers were Sorted based on User's Feedback
Answer / naveen chandra joshi
The question asked is:
What will happen if we r using seton lr after return or vice
versa?
Answer: When we use SETON LR after Return, SETON LR will never be executed because before this operation could be performed, Return will send the control back to the called program.
When we use SETON LR before Return then the program will release all the used resources (like open files, variables, any API used, etc) and then return statement will be executed which will send the control back to the called program. I hope your question has been answered.
Regards,
Naveen Chandra Joshi
+91.9891501280
| Is This Answer Correct ? | 14 Yes | 0 No |
Answer / guest
The system return the control from called program to the
calling program when RETURN encounter.Suppose LR is also ON
after the RETURN executed,all resources will be release.
For example,
A program pgm1 call the another pgm2 within a loop,
/free
num=0;
dow not %error;
callp(e) pgm2();
enddo;
/End-free
The pgm2 where the return is executed before LR turned ON
/free
num=num+1;
return;
/End-free
we can see the value of num will be increase all the time
when pgm1 will call the pgm2.
and opposite case:
/free
num=num+1;
*inlr=*on;
return;
/end-free
value of num will be start from zero.
| Is This Answer Correct ? | 13 Yes | 2 No |
Answer / zhang
Renjith, Return opcode will be execute even you have set on
LR. LR just use to clear envirment, but not leave the
program. If you using seton lr after return, I think the
Seton LR will never be processed. Means that the indicates
and file statues will not be reset.
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / sravan
Seton lr is last record indicator when it reaches system will close all the files what are the programs used in the program return the status will be the same
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / renjith
If we use seton LR before return all the files opened will
get closed and program will exit. Return wont get execute.
Likewise in opposite case it wont execute seton LR
| Is This Answer Correct ? | 1 Yes | 20 No |
Can anybody tell me, does CL/400 handle LEVEL check while running the CL program....? plz share your experience...
what is the procedure and explain about real time scenario.
0 Answers Adhoc Technologies, Hanuman Automation, HSBC, IBM,
Hi,This is raju.Can any body give me the real experience answer for this question? 1.What is the significance of *MAP and *DROP in the CPY command?
How can we know running job is batch or interactive?
what r drawbacks of OPM? Why do we go for ILE RPG?
what is meant by record lock.how records are locked.what is the purpose of record lock.if records are locked what happens.how to find out which record is locked.
what is the necessary command needed before OPNQRYF and why?
What is file identifier where we can use?
How to read alternative records in a pf by using rpg?
purpose of pannel group??/
HOW TO DEBUG A BATCH JOB WHEN IT IS IN MESSAGEWAIT(MSWG) STATUS.I KNOW THE STEPS FOR BATCH DEBUGGING,BUT IM CONFUSING WITH WHEN WE SUBMIT ANY JOB FOR BATCH DEBUG WE PUT IN HELD STATE.SO HERE ALSO DO SAME THING OR ANY OTHER WAY,PLEASE HELP ME....
what is program status data structure?