What will happen if we r using seton lr after return or vice
versa.

Answers were Sorted based on User's Feedback



What will happen if we r using seton lr after return or vice versa...

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 ?    12 Yes 0 No

What will happen if we r using seton lr after return or vice versa...

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

What will happen if we r using seton lr after return or vice versa...

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

What will happen if we r using seton lr after return or vice versa...

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

What will happen if we r using seton lr after return or vice versa...

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

Post New Answer

More RPG400 Interview Questions

We have a Physical file, after reading 5 records,it has to read LF of that same Physical file,Will it start reading from Ist record or will start reading from 5th record?

5 Answers   Hexaware,


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?

2 Answers   Cap Gemini,


what is the necessary keyword needed to scroll subfile records?

0 Answers   IBM,


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

0 Answers   IBM,


I want to declare the number of elements of an array dynamically in RPGLE ? Is it possible? If yes, then how do I do it ?

2 Answers  






How to select highest score of each subject or how to select highest income of every month?

0 Answers  


parameters cannot be passed in which one???

4 Answers   CTS,


Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


i'm working on progA , in that program i want to see the userids of the users who work on this program?

10 Answers   Four soft,


What is Multi Occurrence Data Structure(MODS)?

1 Answers   CTS,


what is an online rpg?

0 Answers   IBM,


Suppose I have 3 jobs a b and c. I want to submit b after successful completion of a and want to submit c after successful completion of b. Without using job scheduler or job queue, how can I do that through cl program?

1 Answers  


Categories