IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

LAst occurence of LISTID in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prafull

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Tue May 13, 2008 5:18 pm
Reply with quote

Hi

If anyone can help out in the following would be really great...

The LMDLIST is checked for all the datasets listed by it, after the last dataset, it is throwing the RC of 8, so the next all code is not excuting properly.
The code is
WRITELINE:
DO
MIFLAG = " "
STROPT = " "
STROPT = INSERT(DSNAME,STROPT,1)
STROPT = INSERT(ZDLCDATE,STROPT,50)
SAY STROPT
PUSH STROPT
END
DO
ADDRESS ISPEXEC
"LMDLIST LISTID(&ID) OPTION(LIST),
DATASET(DSNAME) STATS(YES)"
END

here the RC is 8 so when the function WRITELINE is called next time, its not excuted properly.
Can anybody help out in tracing, if last dataset then anything. I mean to quit or go back kind of options if available? icon_sad.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 13, 2008 5:27 pm
Reply with quote

there are two ways of doing things ...
if all the statements in the loop are always executed then You could

Code:
Address ISPEXEC LMDINIT .....
Address ISPEXEC LMDLIST ....
do while rc = 0
    ....
    .... process
    ....
    Address ISPEXEC LMDLIST ....
end



but there are cases where is better to wrap things in a function

Code:
Address ISPEXEC LMDINIT .....
do while LMDfun(.......) = 0
    ....
    .... process
    ....
    if .... then iterate
    ....
    ....
end
....
....
exit

LMDfun :
    Address ISPEXEC LMDLIST ....
    return RC


both approaches have been tested and found working as planned
Back to top
View user's profile Send private message
prafull

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Tue May 13, 2008 6:21 pm
Reply with quote

Hey thanks
it worked
i used the 2nd method to do it icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 13, 2008 7:37 pm
Reply with quote

that' s my preferred choice in any case, cleaner code icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top