View previous topic :: View next topic
|
Author |
Message |
KeshavKunal
New User
Joined: 21 Jul 2020 Posts: 4 Location: India
|
|
|
|
Hi All,
I am new to REXX and need help in extracting the file names which start with XXXX.YYYY.ZZZZ |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
KeshavKunal
New User
Joined: 21 Jul 2020 Posts: 4 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
|