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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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