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

REXX tool to extract all files starting with XXX.YYYY


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

New User


Joined: 21 Jul 2020
Posts: 4
Location: India

PostPosted: Tue Jul 21, 2020 3:43 pm
Reply with quote

Hi All,

I am new to REXX and need help in extracting the file names which start with XXXX.YYYY.ZZZZ
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Jul 21, 2020 4:23 pm
Reply with quote

I'm not sure what you mean by "extract". Do you just want to find the dataset (not file) names or read the data within them? In any case, you could try:
Code:
X = outtrap("cat.")   
   /* get dataset names in stem cat. */                         
   ADDRESS TSO ,           
     "LISTC ALL LEVEL (XXXX.YYYY.ZZZZ) "           
               
   if RC ¬= 0               
       then do             
        say 'LISTC failed.'
       end                 
                           
   X = OUTTRAP("OFF")     

  do i = 1 to cat.0
    /* read datasets in here, if required.. */
  end


Garry
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jul 21, 2020 4:36 pm
Reply with quote

simpler to use IGGCSI00 ...
well documented in the IBM manuals, pretty easy to use,

WORKING EXAMPLES her on the forum ( a complete script posted by expat - IIRC )

and in SYS1.SAMPLIB
Back to top
View user's profile Send private message
KeshavKunal

New User


Joined: 21 Jul 2020
Posts: 4
Location: India

PostPosted: Tue Jul 21, 2020 6:28 pm
Reply with quote

Thanks for the details & sorry for confusion.

My requirement is to get all the file names which start with "XXXX.YYYY.ZZZZ" and then perform operation on those files.


Garry Carroll wrote:
I'm not sure what you mean by "extract". Do you just want to find the dataset (not file) names or read the data within them? In any case, you could try:
Code:
X = outtrap("cat.")   
   /* get dataset names in stem cat. */                         
   ADDRESS TSO ,           
     "LISTC ALL LEVEL (XXXX.YYYY.ZZZZ) "           
               
   if RC ¬= 0               
       then do             
        say 'LISTC failed.'
       end                 
                           
   X = OUTTRAP("OFF")     

  do i = 1 to cat.0
    /* read datasets in here, if required.. */
  end


Garry
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jul 21, 2020 7:08 pm
Reply with quote

enrico-sorichetti wrote:
simpler to use IGGCSI00 ...
well documented in the IBM manuals, pretty easy to use,

WORKING EXAMPLES her on the forum ( a complete script posted by expat - IIRC )

and in SYS1.SAMPLIB


Search for CSI00 and author Expat
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 Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top