View previous topic :: View next topic
|
Author |
Message |
Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
Hi,
I have 2 files of different record lengths. The second file has just one record. I want to append the contents of the second file to all records of the first file.
Can this be done directly using SYNCSORT?
Thanks in Advance,
Aneesh. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can do this with DFSORT, but you need to give more information about what you're trying to do. Please show an example of the records in file1 and the record in file2 and what you expect for the output records. Please give the RECFM and LRECL of each input file. |
|
Back to top |
|
|
Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
The first file is of 80 bytes(FB) - it has a list of transaction data. The second file is a parm file of 13 bytes (FB) and has the last run date and day(2006-11-24Fri).
The requirement is to append the second file data to the end of every record in the first file.
File1:
Trans1XXXX.....XXX
Trans2XXXX.....XXX
...
File2:(One record only)
2006-11-24Fri
Required output:(the length of the file will be 80 + 13 = 93)
Trans1XXXX.....XXX2006-11-24Fri
Trans2XXXX.....XXX2006-11-24Fri
...
Hope this makes it clear. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Aneesh,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file2 (FB/13) - date record
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT symbol as follows:
* Mydate,'yyyy-mm-ddday'
OUTREC BUILD=(C'Mydate,''',1,13,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=.. input file1 (FB/80) - transactions
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
* Use Mydate to add date at end of records.
INREC OVERLAY=(81:Mydate)
/*
|
|
|
Back to top |
|
|
Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
Thanks a lot, Frank. |
|
Back to top |
|
|
|