Merge three files of different LRECL
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Merge three files of different LRECL Author: vak255 PostPosted: Wed Nov 01, 2006 12:05 pm
    —
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!

#2:  Author: kolusuLocation: San Jose PostPosted: Wed Nov 01, 2006 12:36 pm
    —
vak255,

Please search before posting. Check this link.

http://www.mvsforums.com/helpboards/viewtopic.php?t=5225&highlight=fileaid

Just make sure that you have the 2004 lrecl file as first dsn in the concatanated list.

Kolusu

#3:  Author: Frank YaegerLocation: San Jose PostPosted: Wed Nov 01, 2006 2:04 pm
    —
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.

#4:  Author: kolusuLocation: San Jose PostPosted: Wed Nov 01, 2006 2:28 pm
    —
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

#5:  Author: Frank YaegerLocation: San Jose PostPosted: Wed Nov 01, 2006 3:23 pm
    —
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.

#6:  Author: kolusuLocation: San Jose PostPosted: Thu Nov 02, 2006 8:14 am
    —
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

#7:  Author: vak255 PostPosted: Mon Nov 06, 2006 11:52 am
    —
Kolusu and Frank.

Thanks for your time!
I appreciate.



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group