Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
LAst occurence of LISTID in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: LAst occurence of LISTID in REXX
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue May 13, 2008 5:27 pm    Post subject: Reply to: LAst occurence of LISTID in REXX
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    Post subject: Reply to: LAst occurence of LISTID in REXX
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue May 13, 2008 7:37 pm    Post subject: Reply to: LAst occurence of LISTID in REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us