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
 
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

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