View previous topic :: View next topic
|
Author |
Message |
puneet478
New User
Joined: 03 Jan 2006 Posts: 13 Location: Bangalore india
|
|
|
|
Hi all,
I have the below requirement:
File 1 with a particular layout (Layout 1) having some FB record length.
File 2 with another layout (Layout 2) having different FB record length.
I know the field level details of both the files.
Now, i would like to know if we have both these file structures in two different Copybooks, could we use some JCL utility or something which take File 1 as input and can create File 2 with data from file one.
I can also define how fields in File 1 are mapped to fields in File 2.
Of course, i can write a progam to do but i was wondering if there is an alternate to this.
Thanks,
Puneet |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I moved this to the DFSORT forum since that is a viable option. However, for what it's worth, most shops would use a data mapping system (Cloverleaf, Gentran, Mercator, etc.) to do something like what you are asking. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
i would like to know if we have both these file structures in two different Copybooks, could we use some JCL utility or something which take File 1 as input and can create File 2 with data from file one. |
You can do this with DFSORT, but you'll have to specify the output columns and input fields one at a time. It won't read the Copybooks and do it automatically. You can convert the COBOL declares to DFSORT Symbols using the REXX provided here:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t12
You could then use the Symbols from the output Copybook for the output columns and the Symbols from the input Copybook for the input field names, but you'll still have to specify the output column symbols and input field symbols one at a time. Something like:
Code: |
OPTION COPY
OUTREC BUILD=(outcol1:infield1,
outcol2:infield2,
...)
|
|
|
Back to top |
|
|
|