IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we merge two files using fileaid


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Wed Aug 16, 2006 1:17 pm
Reply with quote

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
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Aug 16, 2006 6:57 pm
Reply with quote

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.
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Wed Aug 16, 2006 11:18 pm
Reply with quote

Thank you for your wonderful solution cpuhwag.


Frank can you provide a solution for this using DFSORT.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top