Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 ?    14 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

In how many ways a session/device error occurs,,, and what is the remedy for it?

3 Answers  


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

1 Answers  


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

1 Answers   HCL,


how do u find whether a record is locked or not??

4 Answers   CTS,


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

2 Answers  


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

0 Answers   Wipro,


can we perform CHAIN operation on Subfile record format....?

4 Answers  


this is rpg3 code W0RTN IFEQ @CN,002 what is the means @CN,002

1 Answers  


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...?

4 Answers  


How can we receive values from a called procedure in CL?

1 Answers   IBM, NTT Data,


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

2 Answers   IBM,


What is a record lock error?

0 Answers   Wipro,


Categories