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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?

496


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

2521


How to declare the pull button in AS/400..

1884


explain sflclr, sflend, sfldlt, and sflcsrrrn?

891


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

519






do you use message subfiles? What are the necessary keywords required coding a message subfile?

692


how does the rpg element work?

720


what is program status data structure?

1392


what is the procedure and explain about real time scenario.

1483


how do you use commitment control in rpg?

759


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

511


what happens when sflsiz = sflpag? What are the advantages and disadvantages?

715


what is the difference between do while and do until?

713


how do I declare a minor?

718


is this a rpg channel?

682