Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4649
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: 4649
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us