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 in which scenario we have to use SQLRPG .(Embeded SQL)....?
what is a rpg?
what is decimal data error? when it will come and how to achieve(rectify) this error please give me solution as well as code
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
In how many ways a session/device error occurs,,, and what is the remedy for it?
1.CA(command Atention key)& CF(command Function key) difference with example?Please can any body tell me in real time exp? 2.Can any body tell me some mandatery function keys using while creating any screen with use of SDA-FUNCTION kEYS?
in which journalling which attributes are necessary??/
How can a screen field that has changed since the last output operation be detected?
WHERE DO WE USE COMIT KEYWORD IN AN RPG PROGRAM? YOU MADE SOME CHANGES TO DATABASE BUT YOU DON'T WANT TO SAVE THOSE CHANGES NOW? HOW DO YOU HANDLE THIS ONE?
When will DUMP & DEBUG be ignored?
RPG/400 number of Records present in a physical file using file information data structure FPF001 IP E DISK F KINFDS INFDS1 IINFDS1 DS I *RECORD RECORD Is this coding correct sir,i have given I P E that is I- input,P-primary file,E-externally described. Primary to use RPG logic cycle,is this the correct method because we have to find number of records present using file information data structure in RPG/400 without doing any input/output operations on the file and also without using DSPFD,SQL. If the above coding is correct means,when i compile the program it gets compiled,but if i call the program it does not return anything,i need number of records,please complete the coding sir.
Can we found a record existance in a file w/o reading the file?
6 Answers Traitsys Technologies,