SETON LR
3 posters
Page 1 of 1
SETON LR
Why do we use SETON LR in RPG?
can we code a RPG without SETON LR//
Thanks,
Raj
can we code a RPG without SETON LR//
Thanks,
Raj
rajkumar400- Posts : 59
Join date : 2010-12-25
Use of SETON LR
Hi,
We can code RPG without SETON LR, by using RETRN ....
WHY SETON LR?
If we use seton LR,the control will transfers to the calling program
(i) By closing the file which is opened in the program.....
(ii) By de-allocating the static variables.....
But if we use RETRN to transfer the control to the calling program,it wont close the file and it wont de-allocate the static variables.....
We can code RPG without SETON LR, by using RETRN ....
WHY SETON LR?
If we use seton LR,the control will transfers to the calling program
(i) By closing the file which is opened in the program.....
(ii) By de-allocating the static variables.....
But if we use RETRN to transfer the control to the calling program,it wont close the file and it wont de-allocate the static variables.....
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Re: SETON LR
Soundar, I have a questions for you. "By closing the file which is opened in the program....." Please clear.
I have a RPGLE program, which has code like below.
EmpDbf I - Input Mode- Keyed access.
-------------
Chain EmpDbf with EmpNo,
Dsply the Employee DEtails.
Set on Lr;
Read EmpDbf; - Is this work or not from this point?
Dow Not EOF
Read EmpPf
Dsply Details.
EndDO
------------
I have a RPGLE program, which has code like below.
EmpDbf I - Input Mode- Keyed access.
-------------
Chain EmpDbf with EmpNo,
Dsply the Employee DEtails.
Set on Lr;
Read EmpDbf; - Is this work or not from this point?
Dow Not EOF
Read EmpPf
Dsply Details.
EndDO
------------
razuk_r- Posts : 65
Join date : 2009-07-31
Location : Chennai
Re: SETON LR
sure it will work,chain and read opcodes get executed...
Even u can hv more than one SETON LR also...It wont throw any error for that..
In first C spec itself if u have SETON LR-no problem,it will go upto last C SPEC and then it wil check for termination...
If there is no SETON LR in C Spec or RETRN,it wil throw an error ,the program doesnt know how to end the program
But wherever it sees the Retrn,control transfers to the calling program without closing opened files and without deallocate static variables...
Am i Right,if not correct me Pls....
Even u can hv more than one SETON LR also...It wont throw any error for that..
In first C spec itself if u have SETON LR-no problem,it will go upto last C SPEC and then it wil check for termination...
If there is no SETON LR in C Spec or RETRN,it wil throw an error ,the program doesnt know how to end the program
But wherever it sees the Retrn,control transfers to the calling program without closing opened files and without deallocate static variables...
Am i Right,if not correct me Pls....
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Re: SETON LR
"By closing the file which is opened in the program....."
ODP-Open Data Path will be deleted...
If a file is opened in a program ,then ODP wil be created b/n program and file.we have to close it...so use SETON LR
ODP-Open Data Path will be deleted...
If a file is opened in a program ,then ODP wil be created b/n program and file.we have to close it...so use SETON LR
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|