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
 

 

How to combine two input files horizontally?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to combine two input files horizontally?
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 2:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL 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 Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 37 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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