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

Error in LMDLIST EXEC


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakeshreddy
Warnings : 1

New User


Joined: 21 Mar 2007
Posts: 28
Location: Bangalore

PostPosted: Mon Jul 05, 2010 7:18 pm
Reply with quote

I want to get the DSList which satisfies given qualifier.

Ex: i have below datasets.

Code:
userid1.abcd
userid1.abc1
userid1.abc2

userid2.abcd
userid2.abc1
userid2.abc2

If i pass userid1.abc*, userid2.abc* i should get all the dataset list i have.

I wrote below REXX:

Code:
K = 1;EXCLSTRING = ''                                                   
"EXECIO * DISKR EXCLUDE (STEM EXCLUDE. FINIS"                           
DO I = 1 TO EXCLUDE.0                                                   
  TEMPVAR = STRIP(EXCLUDE.I)                                           
  ADDRESS ISPEXEC "LMDINIT LISTID(TEMPLIST) LEVEL("TEMPVAR")"           
  DO FOREVER                                                           
    ADDRESS ISPEXEC,                                                   
    "LMDLIST LISTID(&TEMPLIST) OPTION(LIST) DATASET(EXCLDSN) STATS(YES)"
      IF RC \= 0 THEN LEAVE                                             
        EXCLSTEM.K = EXCLDSN                                           
        K = K + 1                                                       
  END /* END OF DO FOREVER */                                           
      ADDRESS ISPEXEC "LMDLIST LISTID(&TEMPLIST) OPTION(FREE)"         
      ADDRESS ISPEXEC "LMDFREE LISTID(&TEMPLIST)"                       
END /* END OF FIRST DO LOOP */                                         


Where EXCLSTEM.K will have all the dsnames meets the criteria.

Am passing the DS Qualifiers from a Input file DD EXCLUDE
userid1.abc*
userid2.abc*

The loop is running fine for First string and writing the list to Stem, but not running for second one. Getting below error.

Code:
    11 *-*   ADDRESS ISPEXEC,                                                   
) DATASET(EXCLDSN) STATS(YES)"                                                 
       >L>     "LMDLIST LISTID(&TEMPLIST) OPTION(LIST) DATASET(EXCLDSN) STATS(YE
       +++ RC(8) +++                                                           
    13 *-*   IF RC \= 0                                                         
       >V>     "8"                                                             
       >L>     "0"                                                             
       >O>     "1"                                                             
       *-*    THEN                                                             
       *-*    LEAVE                                                             
     9 *-*  DO FOREVER                                                         
    17 *-*  ADDRESS ISPEXEC "LMDLIST LISTID(&TEMPLIST) OPTION(FREE)"           
       >L>    "LMDLIST LISTID(&TEMPLIST) OPTION(FREE)"                         
    18 *-*  ADDRESS ISPEXEC "LMDFREE LISTID(&TEMPLIST)"                         
   >L>    "LMDFREE LISTID(&TEMPLIST)"       
19 *-* END /* END OF FIRST DO LOOP */       



Thinking of some FREE Problem. Can some one help me?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 05, 2010 7:26 pm
Reply with quote

please be consistent ...
You tell about rexx, but You are using clist notation for &TEMPLIST
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jul 05, 2010 7:28 pm
Reply with quote

This works for me
Code:
ADDRESS ISPEXEC                                                       
"CONTROL ERRORS RETURN"                                               
                                                                       
DO A = 1 TO LV.0                                                       
  DSET = ''                                                           
  "LMDINIT LISTID(LMD) LEVEL("LV.A")"                                 
  DO FOREVER                                                           
         "LMDLIST LISTID("LMD") OPTION(LIST) DATASET(DSET) STATS(YES)"
         IF RC > 0 THEN LEAVE                                         
         SAY ZDLDSN                                                   
  END                                                                 
END                                                                   
"LMDFREE LISTID("LMD")"                                               
Back to top
View user's profile Send private message
rakeshreddy
Warnings : 1

New User


Joined: 21 Mar 2007
Posts: 28
Location: Bangalore

PostPosted: Mon Jul 05, 2010 9:11 pm
Reply with quote

Thanks Expat,

You gave me the solution. That's working for me too!!
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top