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

How do you find out whether a record is present in the physical file without reading the file? for Example Employee No: 100 in an Employee master.How do we find out whther 100 is present in Employee master without reading the file?

11 Answers   Bank Of America, CSC, IBM,


How to read alternative records in a pf by using rpg?

8 Answers   IBM,


i want to retrieve record b/w 2 dates in as400

2 Answers   L&T,


How can we call CL program to RPG? How many number of parameter we can pass

2 Answers   TCS,


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

0 Answers   HCL,






What are the values of NUM1 and NUM2 after executing the following code? CLONO1NO2NO3 Factorl÷÷+OpcdeFactor2+÷+ResultLenDHHiLoEq C MOVE *LOVAL NUM1 50 C MOVE *J-fIVAL NtJM2 52

2 Answers   Fiserv, IBM,


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 a record lock error?

0 Answers   Wipro,


Can we create 300 logical files based on a single physical file using the CRTLF command only once?.

8 Answers  


Need a sql query: retrieve all duplicate records in table?

1 Answers  


where we give the MSGSFL in rpg400?

4 Answers  


WHAT IS MEANT BY SIGNATURE VAILOTION ERROR

1 Answers   IBM,


Categories