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 AnyOne tell me how to read join logical file in rpg from starting to end?
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...?
what is kids-rpg?
what is file identifier wher we can use
what is overlay? how can we pass parameters in cl or rpg programing? how can we get data area value in cl or rpg programming?
Why did we give STRSRVJOB while debugging batch program
How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique
How to call one program from another program in RPG? please help me with the code
what is EXCEPT command in rpg and use
1.I Have a physical file , i want to read the data from the each and every member of the File in the CL Program.How do you achieve this. 2.How do you do the same in RPG?. do think is it possible to read data from all the members in the RPG?
What is the purpose of FRCDTA keyword?
Anyone help me for the below question:- If problem/error occur in *PSSR subroutine,how should I handel it in RPG program.