ravikumar15
New User
Joined: 27 Mar 2006 Posts: 68
|
|
|
|
Hi,
I have two files file A and file B.
File A has around 5000 records, and file B has only one record.
File A and File B has to be merged to File C.
File A has records upto columns 48, File B has record from column 1-8.
In the File C, 1-48 column should be File A record and 49-56 should be File Bs record.
Is Fileaid suitable for this or Syncsort. Please suggest with code.
Thanks,
Ravi |
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
This can be done with FILEAID, however, it would take two FILEAID steps to accomplish. The 1st FILEAID step could read in the "B" file and create control cards for the 2nd FILEAID step.
Code: |
//FILEAID1 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DISP=SHR,DSN=FILEB
//DD01O DD DSN=FILECC.CARDS,
// DISP=(NEW,CATLG),RECFM=F,LRECL=80,BLKSIZE=80,
// UNIT=(SYSDA),SPACE=(TRK,(50,50),RLSE)
//SYSIN DD *
$$DD01 CA PADCHAR=C' ',
MOVE=(1,C"$$DD01 CA MOVE=(1,48,1),MOVE=(49,C'"),
MOVE=(36,8,1),MOVE=(44,C"')")
//FILEAID2 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DISP=SHR,DSN=FILEA
//DD01O DD DSN=FINAL.OUTPUT.FILE,
// DISP=(NEW,CATLG),RECFM=F,LRECL=56,BLKSIZE=0,
// UNIT=(SYSDA),SPACE=(TRK,(5,5),RLSE)
//SYSIN DD DISP=SHR,DSN=FILECC.CARDS
|
When FILEAID1 executes, the FILECC.CARDS dataset will contain:
Code: |
$$DD01 CA MOVE=(1,48,1),MOVE=(49,C'xxxxxxxx')
|
where xxxxxxxx is position 1-8 of the record from FILE B.
When FILEAID2 executes, it copies all records (CA=copyall) and move positions 1 through 48 from FILE A to the output file and appends the 8 positions from FILE B to the end of each record.
The best method would probably be IBM's DFSORT program where it could be done in one step and I'm sure Frank Yaeger can create you a solution using their product. |
|