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

How to combine 2 files into a single output file


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

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Mon Dec 21, 2009 9:27 am
Reply with quote

I have a requirement.

1st Input file

A
B
C
D

2nd Input file data

E
F
G
H

My output file should be

A
E
B
F
C
G
D
H
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Dec 21, 2009 10:26 am
Reply with quote

Why to use DFSORT for such a request????
Why not just IEBGENER?

Concatenate your input datasets as SYSUT1
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Dec 21, 2009 10:45 am
Reply with quote

Ohh.. sorry... I missed it....you need one one records from both input dataset and so on...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Dec 21, 2009 10:46 am
Reply with quote

Hello,

I believe the output is to be the data from the 2 input files interleaved.

Unfortunately, this is another of the "guess what i want" topics as Sakrish could not be bothered to explain the "requirement". . .
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Dec 21, 2009 11:10 am
Reply with quote

According to my understanding this is what you want...
Am assuming input LRECL and RECFM is 80 and FB respectively

Code:

//S1    EXEC  PGM=ICETOOL                   
//SYSOUT    DD  SYSOUT=*                   
//DFSMSG    DD  SYSOUT=*                   
//TOOLMSG   DD  SYSOUT=*                   
//IN1 DD *                                 
A                                           
B                                           
C                                           
D                                           
//IN2 DD *                                 
E                                           
F                                           
G                                           
H                                           
//TMP DD  DSN=&TEMP,DISP=(MOD,PASS)         
//OUT DD  SYSOUT=*                         
//TOOLIN   DD    *                         
  COPY FROM(IN1) TO(TMP) USING(CTL1)       
  COPY FROM(IN2) TO(TMP) USING(CTL2)                 
  SORT FROM(TMP) TO(OUT) USING(CTL3)                 
/*                                                   
//CTL1CNTL DD    *                                   
  OPTION COPY                                       
  INREC OVERLAY=(81:SEQNUM,8,ZD,START=1,INCR=2)     
//CTL2CNTL DD    *                                   
  OPTION COPY                                       
  INREC OVERLAY=(81:SEQNUM,8,ZD,START=2,INCR=2)     
//CTL3CNTL DD    *                                   
  SORT FIELDS=(81,8,ZD,A)                           
  OUTREC BUILD=(1,80)                               

Output will be
Code:

A
E
B
F
C
G
D
H
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Dec 21, 2009 11:14 am
Reply with quote

Hi,

this might assist
Code:
//STEP0001 EXEC PGM=ICETOOL                             
//TOOLMSG  DD SYSOUT=*                                 
//DFSMSG   DD SYSOUT=*                                 
//FILE1 DD *                                           
A                                                       
B                                                       
C                                                       
D                                                       
/*                                                     
//FILE2 DD *                                           
E                                                       
F                                                       
G                                                       
H                                                       
/*                                                     
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),                 
//         UNIT=SYSDA,SPACE=(TRK,(10,5),RLSE)           
//FINAL DD SYSOUT=*                                                 
//TOOLIN DD *                                                       
  COPY FROM(FILE1) TO(TEMP1) USING(CTL1)                           
  COPY FROM(FILE2) TO(TEMP1) USING(CTL2)                           
  SORT FROM(TEMP1) TO(FINAL) USING(CTL3)                           
/*                                                                 
//CTL1CNTL DD *                                                     
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,START=1,INCR=2)                   
/*                                                                 
//CTL2CNTL DD *                                                     
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,START=2,INCR=2)                   
/*                                                                 
//CTL3CNTL DD *                                                     
  SORT FIELDS=(81,8,ZD,A)                                           
  OUTREC BUILD=(1,80)                                               
/*                                                                 



Gerry
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Dec 21, 2009 11:25 am
Reply with quote

Gerry wrote:

Hi,

this might assist


We think exactly same.... icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Mon Dec 21, 2009 11:53 am
Reply with quote

Thanks to gcicchet and Sambhaji.

It worked fine.
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 Binary File format getting change whi... All Other Mainframe Topics 7
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
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
Search our Forums:

Back to Top