Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
copying multiple files with unknown sufix

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: copying multiple files with unknown sufix
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

Moderator Team Head


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

PostPosted: Wed Oct 03, 2007 1:06 am    Post subject: Reply to: copying multiple files with unknown sufix
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:

http://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: 2360
Location: Israel

PostPosted: Wed Oct 03, 2007 1:12 am    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Oct 03, 2007 6:02 am    Post subject: Reply to: copying multiple files with unknown sufix
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us