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
 

 

HOW TO keep multiple occurences of duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: HOW TO keep multiple occurences of duplicates
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 19, 2008 3:16 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Aug 19, 2008 3:22 pm    Post subject: Reply to: HOW TO keep multiple occurences of duplicates
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    Post subject: HOW TO keep multiple occurences of duplicates
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: 1288
Location: Chennai, India

PostPosted: Tue Aug 19, 2008 4:05 pm    Post subject: Reply to: HOW TO keep multiple occurences of duplicates
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 Moderator


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

PostPosted: Tue Aug 19, 2008 9:49 pm    Post subject:
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    Post subject: HOW TO keep multiple occurences of duplicates
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


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