Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts Can we merge these two sort cards int... abdulrafi JCL & VSAM 2 Thu Mar 08, 2018 4:03 pm
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us