MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Merge three files of different LRECL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Nov 01, 2006 12:05 pm    Post subject: Merge three files of different LRECL Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Wed Nov 01, 2006 12:36 pm    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Nov 01, 2006 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Wed Nov 01, 2006 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Nov 01, 2006 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Nov 02, 2006 8:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 06, 2006 11:52 am    Post subject: Reply with quote

Kolusu and Frank.

Thanks for your time!
I appreciate.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group