Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 10211
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: 10211
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us