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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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