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

copying multiple files with unknown sufix


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

New User


Joined: 02 Oct 2007
Posts: 2
Location: KY, US

PostPosted: Wed Oct 03, 2007 12:49 am
Reply with quote

Hi,
I have multiple files daily with format AAAA.BBB.DTnnnn.THHMMSS.

These files are created using the MGET ftp command and copied from another host system.

Once the FTP step runs, I need to copy these files (maybe 1 or more) to another predefined dataset, so that I can process them further.

Can you please give me a guidline if REXX or anyother M/F utilities can be used (like copying the files XXXX.YYY.* to XXXX.YYY.COMBINED).

Any help will be greatly appreciated.

Regards,
Nishant
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Oct 03, 2007 1:06 am
Reply with quote

I have to preface my reponse with my observation that your approach to this process leaves a lot to be desired. It's never a good practice to issue an MGET on a remote server and retrieve an unknown number of files. I think you're much better off building a series of GET statements first, then "getting" each file individually to the single output DD (with DISP=MOD specified, of course) and avoiding this whole mess to begin with.

That being said, sticking with a response for REXX, just use the TSO LISTCAT command to find all of the datasets cataloged to the high-level qualifier (in your example AAA.BBB). Then, build the TSO ALLOCATE statement(s) as you desire (either allocating each dataset one-at-a-time or concatenating them all together) and run the copy utility of your choice (IEBGENER/SORT/REPRO).

The post directly below this one has an example of using LISTCAT:

www.ibmmainframes.com/viewtopic.php?t=24879
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Oct 03, 2007 1:12 am
Reply with quote

Another method is to use the ISPF service LMDLIST.

O.
Back to top
View user's profile Send private message
nishantny

New User


Joined: 02 Oct 2007
Posts: 2
Location: KY, US

PostPosted: Wed Oct 03, 2007 2:37 am
Reply with quote

Kevin,

Thanks so much. I understand your point, but the problem is the process at the host (its another vendor outside) is difficult to change. I.e. they highly prefere creating files as per there standards ie. AAAA.BBB.date and time. But since I wont have that info , MGET is the only option, I suppose.

But thanks so much, I will try to implment as per your suggestion, and also the example you gave are very handy since I havent had much of REXX.

Thanks,
Nishant
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Oct 03, 2007 6:02 am
Reply with quote

Just an FYI, you can do the same process in batch, or in just about any programming or scripting language you wish. You don't have to use REXX.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top