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 |
In how many ways a session/device error occurs,,, and what is the remedy for it?
Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?
1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?
how do u find whether a record is locked or not??
Given the following code, what is the value of RESULT? DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++ D RESULT S 5 0 C EVAL RESULT = (2 + 3 * 2) ** 2 / 2
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
can we perform CHAIN operation on Subfile record format....?
this is rpg3 code W0RTN IFEQ @CN,002 what is the means @CN,002
One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?
How can we receive values from a called procedure in CL?
2. Which of the following statement(s) explains the difference(s) between the /INCLUDE and ICOPY directives? a.) No difference, they function the same b.) ACOPY cannot be used as a conditional directive c.) IINCLUDE files cannot contain embedded SQL d.) Nesting /TNCLUDE directives is not allowed
What is a record lock error?