View previous topic :: View next topic
|
Author |
Message |
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Hi,
I am having 3 files with different record lengths say,
1st file with record length:100
2nd file with record lenght :150
3rd file with record length: 40
All three are of Variable block.
And I want these 3 files to be concatenated/merged in to single file of maximum length which will be a fixed block record.
Could you please provide me the solution for this with the JCL ASAP.
This is bit urgent.
Thanks in advance,
Praveen.N |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
praveensn
Do certain fields from the different files need to be alligned, or is this a straight copy of the data asis with no internal movements.
Concatenated is different from merged. If this is really a merge, on what keys is the merge to be performed.
What have you tried so far, and what results did you get ?
Quote: |
This is bit urgent. |
It maybe urgent, but only for you. Please remember that forum members do this in their own time. |
|
Back to top |
|
|
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Hi,
Apoligies for that,
This is a straight copy of the three files in to one output file.
I have tried to copy the 2 input files of different record lengths, where one is of 240 and another is 479 in to an output file of 600 record length through VTOF (Variable to Fixed).
Please find the JCL for this.
Code: |
//STEP040 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=nupyn24.DB2NAT.DISK200,DISP=SHR
// DD DSN=nupyn24.DB2NAT.DISk700C,DISP=SHR
//SORTOUT DD DSN=nupys45.SORT.OUTPUT1,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(300,100),RLSE)
//SYSIN DD *
SORT FIELDS=(5,470,CH,A)
OUTFIL FNAMES=SORTOUT,VTOF,
OUTREC=(1,600)
/*
|
Here nupyn24.DB2NAT.DISK200 is of record length 240 and
nupyn24.DB2NAT.DISk700C is 479 record length.
And i am trying to copy the data of the 2 files in to
nupys45.SORT.OUTPUT1 which is of 600 length but not able to do so.
I am getting the below error.
RECORD TYPE IS V - DATA STARTS IN POSITION 5
END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH
Thanks,
Praveen.N |
|
Back to top |
|
|
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Adding to the above both the records are Variable block and I want them to convert it to a fixed block of maximum say 600 record length.
Thanks,
Praveen.N |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Since you said you wanted to do a COPY, I used OPTION COPY rather than SORT. I assumed you didn't want to keep the RDW of the VB files so I used 5,475. The trick is to specify p,m according to the maximum LRECL and then use 600:X to pad the records out.
Code: |
//STEP040 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=nupyn24.DB2NAT.DISK200,DISP=SHR
// DD DSN=nupyn24.DB2NAT.DISK700C,DISP=SHR
//SORTOUT DD DSN=nupys45.SORT.OUTPUT1,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(300,100),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL VTOF,BUILD=(5,475,600:X)
/*
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
I suppose there was some reason for posting the same question multiple times within such a short time frame
The other has been locked. . .
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dick,
I deleted the dup thread after you locked it. No reason to keep it. |
|
Back to top |
|
|
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Frank,
Thanks a lot for the JCL, it is working fine.
Thanks,
Praveen.N |
|
Back to top |
|
|
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Hi All,
I had one more query,
I am having 3 files with different record lengths say,
1st file with record length:100
2nd file with record lenght :150
3rd file with record length: 40
All three are of Variable block.
And I want these 3 files to be concatenated/merged in to single output file which is also a variable block.
Thanks in advance,
Praveen.N |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Use IDCAMS, SORT, IEBGENER, ... with input as 3 concatenated files and output is one file with LRECL at least as long as longest input file LRECL. |
|
Back to top |
|
|
praveensn
New User
Joined: 30 Jul 2008 Posts: 32 Location: Pune
|
|
|
|
Robert,
Thanks a lot.
Its working fine now.
Regards,
Praveen.N |
|
Back to top |
|
|
|