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

Copy files dynamically


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Feb 29, 2008 11:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top