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 2 files into a single output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to combine 2 files into a single output file
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Dec 21, 2009 10:46 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Dec 21, 2009 11:14 am    Post subject:
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    Post subject:
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    Post subject: Reply to: How to combine 2 files into a single output file
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    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 Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm

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