Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we merge two files using fileaid

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
View previous topic :: :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Wed Aug 16, 2006 1:17 pm    Post subject: Can we merge two files using fileaid
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    Post subject: Re: Can we merge two files using fileaid
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: 64

PostPosted: Wed Aug 16, 2006 11:18 pm    Post subject: Re: Can we merge two files using fileaid
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    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us