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
 

 

Merge two files key located in different position of i/p fil

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Mar 13, 2007 7:26 pm    Post subject: Merge two files key located in different position of i/p fil
Reply with quote

Hi,

I need to merge two files into an output filoe.

For Ex: I have the following records in the First Input file

File 1:

KEY
ABCD XXXX
ABCE XXXX Key starts from 1 to 4
ABCF XXXX <<= We can assure that the file is sorted on KEY

File 2:
KEY
YYYYYYYY ABCD
FFFFFF ABCE Ket starts from 30 34
GGG ABCF <<= The file is sorted on the Key

I Expect the output as follows:

ABCD XXXX
YYYYYYYY ABCD
ABCE XXXX
FFFFFF ABCE
ABCF XXXX
GGG ABCF <<< All keys should be sorted

Please let me know how to code using ICETOOL??

~Vamsi
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Mar 13, 2007 10:08 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
ABCD      XXXX
ABCE      XXXX
ABCF      XXXX
/*
//IN2 DD *
YYYYYYYY                     ABCD
FFFFFF                       ABCE
GGG                          ABCF
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SORT FROM(T1) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:1,4)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:30,4)
/*
//CTL3CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(81,4,CH,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Mar 15, 2007 8:04 pm    Post subject: Re: Merge two files key located in different position of i/p
Reply with quote

Hi Frank,

Ur code worked exactly whatz required,

Thanks alot
~Vamsi
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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