View previous topic :: View next topic
|
Author |
Message |
siddhartha biswas Currently Banned New User
Joined: 04 May 2008 Posts: 15 Location: india
|
|
|
|
Hi all,
I need to merge three variable block files with different record lengths (header, trailer and content files) into one file. But for that I should increase the record length of the header and trailer files to make it equal to the length of the content file. Do any one has a solution for this? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
siddhartha,
For VB files, RDW field will hold lengths of individual records.
Could you please post a few sample records with file-attributes of input/output files.
Thanks,
Arun |
|
Back to top |
|
|
siddhartha biswas Currently Banned New User
Joined: 04 May 2008 Posts: 15 Location: india
|
|
|
|
Header record (vb) lrecl: 50
Content record(vb) lrecl: 150
Trailer record (vb) lrecl: 50
I need to increse the length of header and trailer records to 150 so that I can merge all three files in the same sequence as given above. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Simplest way is to use VTOF and make all files to fixed length(max of all)
then you can easily merge it to one... |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
Simplest way is to use VTOF and make all files to fixed length(max of all)
then you can easily merge it to one... |
Even simpler would be to have the output file DCB set to the longest (i.e. 150). A VB file, by definition, can contain records that are shorter than the LRECL.
Garry. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
siddhartha,
As pointed out by Garry, you can achieve this by setting the Output LRECL to the maximum of all the 3 files.
You might want to give this a try.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=..Header-file --------> VB,LRECL=50
// DD DISP=SHR,DSN=..Data-file --------> VB,LRECL=150
// DD DISP=SHR,DSN=..Trailer-file --------> VB,LRECL=50
//SORTOUT DD DISP=MOD,DSN=..Output-file --------> VB,LRECL=150
//SYSIN DD *
SORT FIELDS=COPY |
Thanks,
Arun |
|
Back to top |
|
|
|