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

HOW TO keep multiple occurences of duplicates


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

New User


Joined: 19 Aug 2008
Posts: 7
Location: bhubanaswer

PostPosted: Tue Aug 19, 2008 3:07 pm
Reply with quote

I have two files with a key in bytes 1-3 and data in bytes 5-9.
File A has the following records
000 $$$$$
001 AAAAA
002 CCCCC
003 EEEEE
004 GGGGG
File B has the following records:
001 BBBBB
001 XXXXX
003 DDDDD
003 YYYYYY
004 FFFFF
005 HHHHH

I need the following output
001 AAAAA BBBBB
001 AAAAA XXXXX
003 EEEEE DDDDD
003 EEEEE YYYYYY
004 GGGGG FFFFF

how to do that icon_exclaim.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 19, 2008 3:16 pm
Reply with quote

There was an example earlier today which had been moved to the JCL forum because it turned out that the product being used was SYNCSORT rather than DFSORT.

The code given is DFSORT code, but luckily worked for SYNCSORT too.

Click here to take a look at an example of the SPLICE part of ICETOOL.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Aug 19, 2008 3:22 pm
Reply with quote

Debanand,

Welcome to teh forums. Check this JCL.

Code:
//STEPS200 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD *                                                       
000 $$$$$                                                             
001 AAAAA                                                             
002 CCCCC                                                             
003 EEEEE                                                             
004 GGGGG                                                             
/*                                                                   
//IN2      DD *                                                       
001 BBBBB                                                             
001 XXXXX                                                             
003 DDDDD                                                             
003 YYYYYY                                                           
004 FFFFF                                                             
005 HHHHH                                                             
/*                                                                   
//T1 DD DSN=&&TESC1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),               
// UNIT=SYSDA                                                         
//TOOLIN   DD *                                                       
  COPY FROM(IN1) TO(T1) USING(CTL1)                                   
  COPY FROM(IN2) TO(T1) USING(CTL2)                                   
  SPLICE FROM(T1) TO(OUT) ON(1,3,CH) WITH(11,5) WITHALL               
/*                                                                   
//CTL1CNTL DD *                                                       
  OUTREC FIELDS=(1:1,3,5:5,5,11:5X)                                   
/*                                                                   
//CTL2CNTL DD *                                                       
  OUTREC FIELDS=(1:1,3,11:5,5)                                       
/*                                                                   
//OUT      DD SYSOUT=*   


output:

Code:
********************************* TOP OF DATA **********************************
001 AAAAA BBBBB                                                                 
001 AAAAA XXXXX                                                                 
003 EEEEE DDDDD                                                                 
003 EEEEE YYYYY                                                                 
004 GGGGG FFFFF                                                                 
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
debanandaghosh
Currently Banned

New User


Joined: 19 Aug 2008
Posts: 7
Location: bhubanaswer

PostPosted: Tue Aug 19, 2008 3:59 pm
Reply with quote

Thanks dude.It is working fine .

Now let me to explain my problem

I have one flat file having 920 LRECL .In this file 8th byte to 16byte will be used as key which can be occur repeatedly
Like as follows

Code:

PPPPPPP111111111RWEIRUEWROPIWERPI.....................
RRRRRRR111111111E2WEQWEQWEQWE76........................
SSSSSSS222222222RERQWEREQWRER656.......................
FFFFFFF333333333RERWEREWEWRERWEER.......................
GGGGGGG333333333RTGHHRETERWEREW.......................


And i have another file having following format(1-9 th byte the key and in the 11 th byte one flag)

Code:

111111111 Y
222222222 N
333333333 Y


Now i need to merge the files so that i get the following output(New flag of 2nd file will be in 922th field) .

Code:

PPPPPPP111111111RWEIRUEWROPIWERPI.....................Y
RRRRRRR111111111E2WEQWEQWEQWE76.......................Y
SSSSSSS222222222RERQWEREQWRER656......................N
FFFFFFF333333333RERWEREWEWRERWEER.....................Y
GGGGGGG333333333RTGHHRETERWEREW.......................Y
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Aug 19, 2008 4:05 pm
Reply with quote

Debanand,

Quote:
Thanks dude.It is working fine .


You are welcome.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Aug 19, 2008 9:49 pm
Reply with quote

Debanand,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed you wanted the output records to be 922 bytes long.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=... input file (FB/910)
//IN2 DD DSN=... input file (FB/11)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/922)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(8,9,CH) WITHALL WITH(1,921)
/*
//CTL1CNTL DD *
  INREC BUILD=(8:1,9,922:11,1)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(922:X)
/*
Back to top
View user's profile Send private message
debanandaghosh
Currently Banned

New User


Joined: 19 Aug 2008
Posts: 7
Location: bhubanaswer

PostPosted: Wed Aug 20, 2008 10:23 am
Reply with quote

Thanks for simpler approach
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top