View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Nov 01, 2006 12:05 pm Post subject: Merge three files of different LRECL |
|
|
Hi,
I have three files.
FILE1: Dsorg: PS Recfm= VB Lrecl= 23472
file2: LRECL = 2004, VB, ps
FILE3: LRECL=2004, VB, ps
I need only the first 2004 bytes from each record of file1 and then
I need to merged the above files into single file.
Thanks for your help and time! |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12360 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Nov 01, 2006 2:04 pm Post subject: |
|
|
kiran,
That link doesn't really address your requirement since it deals with FB records, whereas you're dealing with VB records and you want to truncate the records in the first file. Here's a DFSORT job that will do what you asked for (I assumed you wanted to "copy" the files to the output data set in order rather than merging them which would require a key).
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1 (VB/23472)
// DD DSN=... input file2 (VB/2004)
// DD DSN=... input file3 (VB/2004)
//SORTOUT DD LRECL=2004,DSN=... output file (VB/2004)
//SYSIN DD *
OPTION COPY,VLLONG
/*
|
VLLONG tells DFSORT to truncate any records longer than the SORTOUT LRECL of 2004 to 2004 bytes. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12360 Topics: 75 Location: San Jose
|
Posted: Wed Nov 01, 2006 2:28 pm Post subject: |
|
|
frank,
Fileaid automatically adjusts the Output lrecl based on the INPUT DSN. So if he concatenates the 2004 LRECL first then the output will also be 2004.
Kolusu _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Nov 01, 2006 3:23 pm Post subject: |
|
|
Kolusu,
I was referring to the sort examples at that link, not the FILEAID examples. I don't know anything about FILEAID.
But I find it interesting that for a VB input concatenation of 2004/23472/2004, FILEAID would choose 2004 (the first LRECL) as the output LRECL even when there's a larger LRECL in the concatenation. That could cause truncation automatically assuming the file with LRECL-23472 had records greater than 2004 bytes (which wouldn't be unusual). That's certainly not what you'd normally want.
By contrast, with a VB input concatenation of 2004/23472/2004, DFSORT would choose 23472 (the largest LRECL in the concatenation) as the output LRECL so records would not be automatically truncated. With DFSORT, you'd have to take the explicit actions of specifying the output LRECL and using VLLONG to "force" truncation. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12360 Topics: 75 Location: San Jose
|
Posted: Thu Nov 02, 2006 8:14 am Post subject: |
|
|
Frank,
Fileaid derives the output DCB properties from the first input DSN. It truncates the rest even when there is a larger lrecl in the concatenation list. It gives a return code of 4(default) specifying that a truncation has occured.
Kolusu _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 06, 2006 11:52 am Post subject: |
|
|
Kolusu and Frank.
Thanks for your time!
I appreciate. |
|
Back to top |
|
|
|
|