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: 1104
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: 10765
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 Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts REXX allocated datasets in JCL CLIST & REXX 9
No new posts getting RC=3650 when invoking REXX wi... CLIST & REXX 7
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
This topic is locked: you cannot edit posts or make replies. I HAVE 2 INPUT FILES WITH SAME LAYOUT... COBOL Programming 6
Search our Forums:

Back to Top