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
 

 

Copy files dynamically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
dharunvarsha06

New User


Joined: 03 Aug 2007
Posts: 1
Location: USA

PostPosted: Fri Feb 29, 2008 10:56 pm    Post subject: Copy files dynamically
Reply with quote

i have to copy records from a ps file to multiple ps files depending upon a criteria
ex:
i/p file:
-------
GX0001 3 4 GT777 dddd aaa
GX0001 3 4 GT777 dddd bbb
GX0002 3 4 GT777 dddd ccc
GX0003 3 4 GT777 dddd ddd
GX0004 3 4 GT777 dddd eee
GX0004 3 4 GT777 dddd ffff
GX0004 3 4 GT777 dddd ggg

o/p files:
I have to create these files dynamically as per the records in the input file (first 6 bytes is the key)
xx.xxxx.GX0001.DMMDDYYY.THHMM
xx.xxxx.GX0002.DMMDDYYY.THHMM
xx.xxxx.GX0003.DMMDDYYY.THHMM
xx.xxxx.GX0004.DMMDDYYY.THHMM
( where MMDDYYY - current date & HHMM current time)
and copy the following records
GX0001 3 4 GT777 dddd aaa
GX0001 3 4 GT777 dddd bbb
to xx.xxxx.GX0001.DMMDDYYY.THHMM
&
GX0002 3 4 GT777 dddd ccc
to xx.xxxx.GX0002.DMMDDYYY.THHMM
&
GX0003 3 4 GT777 dddd ddd
to xx.xxxx.GX0003.DMMDDYYY.THHMM
&
GX0004 3 4 GT777 dddd eee
GX0004 3 4 GT777 dddd ffff
GX0004 3 4 GT777 dddd ggg
to
xx.xxxx.GX0004.DMMDDYYY.THHMM

Please let me know whether we can get this done out of rexx.
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Fri Feb 29, 2008 11:16 pm    Post subject: Reply to: Copy files dynamically
Reply with quote

You could use REXX, CLIST, COBOL, standard utilities, or whatever else you wish to. It seems like a relatively straight-forward process.

You'll probably want to run this in a TSO address space and use the TSO ALLOCATE command to create and catalog the datasets with all of their required attributes. Some simple file I-O and basic looping.

- Read record from the file.
- If first index, create the dataset name using the index value and the current date/time values. Write the first record to the output.
- If same index, just write to the output.
- When the index changes, close the output, and go back to the second step.
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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