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

How to combine two input files horizontally?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Thu Mar 29, 2007 2:26 pm
Reply with quote

Hi all........

I have an input file like

Code:
field A         Field B
123              12.34
234              22.1
345              45.12

another input file....

Code:
field A         Field C
123              102.34
234               20.1
345               49.12

I wanna get the output which should be like the following 1

Code:
field A         Field B     Field C
123              12.34      102.34
234              22.1        20.1
345              45.12       49.12

(No need of headers as mentioned.......)

Is it possible? If so How?

Thanking you........
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 2:33 pm
Reply with quote

Here's an example using DFSORT that Frank has used before. I've kept it as a reference to do this type of process.

You need to reformat the two sets of records and then SPLICE them together. The original comments are still embedded into the source code.

Code:

//S1       EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=&PREFIX.&SYSUID..&SYSTID.TEST.ONE,DISP=SHR         
//IN2      DD DSN=&PREFIX.&SYSUID..&SYSTID.TEST.TWO,DISP=SHR         
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)     
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                               
* REFORMAT IN1 TO CONTAIN:                                   
* | BLANKS | KEY | IN1 DATA |                                 
  COPY FROM(IN1) TO(T1) USING(CTL1)                           
* REFORMAT IN2 TO CONTAIN:                                   
* | IN2 DATA | KEY | BLANKS |                                 
  COPY FROM(IN2) TO(T1) USING(CTL2)                           
* SPLICE THE MATCHING IN1/IN2 RECORDS TO PRODUCE:             
* | IN2 DATA | KEY | IN1 DATA |                               
  SPLICE FROM(T1) TO(OUT) ON(14,3,CH) -                   
  WITHALL WITH(1,13)                                         
/*                                                           
//CTL1CNTL DD *                                               
  OUTREC FIELDS=(14:1,3,17:4,26,60:X)                         
/*                                                           
//CTL2CNTL DD *                                               
  OUTREC FIELDS=(1,20,60:X)                                   
/*                                                           
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top