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

Removing duplicate's from VB file which has H & D recs


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Tue Nov 11, 2008 5:20 pm
Reply with quote

hi all,

I want to remove dupliactes from a VB file's which has Header & Detail records which are in the format shown below.

File 1 - CG82.TSO.SOURCE.NOV11 VB(470 length(H rec) - 145 length(D rec)) - H & D positions are (63+4) - due to space constraint i have not showed all fields.
1) The H rec is always 470 bytes & D rec is always 145 length
2) The will always be one H & one D records as in the file below.

Code:
 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
         1064458   LW900063774                   20081007123031H                                    LW9000
         1003      LW900063774                                 D                    0B9RAKIYX1702         
         1064458   LW900063843                   20081007123031H                                    LE8000
         1009      LW900063843                                 D                    0BE7HFN412408         


File - 2 - CG82.TSO.SOURCE.NOV11A VB(470 length(H rec) - 145 length(D rec)) - H & D positions are (63+4) - due to space constraint i have not showed all fields.
1) The H rec is always 470 bytes & D rec is always 145 length
2) The will always be one H & one D records as in the file below.

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
        1064458   LW900063843                   20081007123031H                                    LE8000
        1009      LW900063843                                 D                    0BE7HFN412408         
        1064458   LW900057809                   20081007123031H                                    LW9000
        1014      LW900057809                                 D                    0HCP8HYUX0205         


i need output in the same variable format as the input files
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
        1064458   LW900063774                   20081007123031H                                    LW9000
        1003      LW900063774                                 D                    0B9RAKIYX1702         
        1064458   LW900057809                   20081007123031H                                    LW9000
        1014      LW900057809                                 D                    0HCP8HYUX0205         


The process is i'm appending file - 1 & file - 2 , then need to eliminate duplicates, i tried with the icetool step below but only H type records were coming in the output

Code:
//IN       DD DSN=CG82.TSO.SOURCE.NOV11,DISP=SHR             
//         DD DSN=CG82.TSO.SOURCE.NOV11A,DISP=SHR             
//TOOLIN   DD  *                                             
 SELECT FROM(IN) TO(OUT) USING(CTL1) FIRST ON(23,15,CH)                   
/*                                                           
//                                                           
//CTL1CNTL DD *                                               
  OPTION VLSHRT                                               
/*                                                           
//OUT      DD DSN=CG82.TSO.SOURCE.INT,DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(10,10),RLSE)                           


I'm still exploring icetool ... let me know if this can be done!

Thanks in advance.
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Tue Nov 11, 2008 5:21 pm
Reply with quote

hi sorry for one more post,

when i previewed ... the files was showing correctly ... here it has come on the second line .... can any of the moderator help me out?
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 Nov 11, 2008 11:24 pm
Reply with quote

If I understand what you want (and I'm not sure I do), this DFSORT/ICETOOL job will do it. The output records will be sorted by the 23,15,CH field. If you really need the output records in the original order of the input records, let me know.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON      DD DSN=CG82.TSO.SOURCE.NOV11,DISP=SHR
//         DD DSN=CG82.TSO.SOURCE.NOV11A,DISP=SHR
//OUT      DD DSN=CG82.TSO.SOURCE.INT,DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(10,10),RLSE)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(23,15,CH) ON(67,1,CH) NODUPS USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(23,15,CH,A,67,1,CH,D)
/*
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Wed Nov 12, 2008 9:58 am
Reply with quote

hi frank,

thanks for the reply... that one does the trick...

one correction to my posting .... i wanted the first duplicate to exist & changed accordingly.

the jcl sort's all the record on the key in ascending order ... well as i said in the first post .... i need them in original order.
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: Wed Nov 12, 2008 10:14 pm
Reply with quote

Quote:
i wanted the first duplicate to exist & changed accordingly.


I don't know what you mean by that. Your example output has records with values at 23 and and 67 (H and D) that only appear in one of the input files. That would be a NODUPS situation. I don't know what you changed or what you mean by "wanted the first duplicate to exist". You need to explain more clearly what you want and what you changed, with examples that illustrate it.

Quote:
as i said in the first post .... i need them in original order.


Given that there are two input files, what exactly do you mean by "the original order"? Do you mean in the original order of the records from file1 and then the records from file2? Or do you mean something else? It would help if you showed an example with more input and output records that made it clear what you mean.
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Mon Nov 17, 2008 11:20 am
Reply with quote

hi,

sorry for late reply ...

Quote:
Do you mean in the original order of the records from file1 and then the records from file2?

i wanted the above scenario ...

thanks in advance.
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: Mon Nov 17, 2008 11:02 pm
Reply with quote

Getting the records in that order is a bit trickier, but you can do it with the DFSORT/ICETOOL job below. It uses DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that PTF installed, ask your System Programmer to install it.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1      DD DSN=CG82.TSO.SOURCE.NOV11,DISP=SHR
//IN2      DD DSN=CG82.TSO.SOURCE.NOV11A,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT      DD DSN=CG82.TSO.SOURCE.INT,DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(10,10),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(T2) ON(32,15,CH) ON(76,1,CH) NODUPS
SORT FROM(T2) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'0',14:5)),
    IFTHEN=(WHEN=GROUP,BEGIN=(76,1,CH,EQ,C'H'),RECORDS=2,
      PUSH=(6:ID=8))
/*
//CTL2CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'1',14:5)),
    IFTHEN=(WHEN=GROUP,BEGIN=(76,1,CH,EQ,C'H'),RECORDS=2,
      PUSH=(6:ID=8))
/*
//CTL3CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(5,9,ZD,A,76,1,CH,D)
  OUTREC BUILD=(1,4,5:14)
/*
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Tue Nov 18, 2008 12:46 pm
Reply with quote

hi frank,

Thanks for the reply ...

sadly our shop doesnt have this .... icon_cry.gif

thanks for the time .... i'll use the sorted one from the first reply icon_lol.gif
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 Nov 18, 2008 9:44 pm
Reply with quote

Quote:
sadly our shop doesnt have this


Ask your System Programmer to install that DFSORT PTF (it's free).
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Wed Nov 19, 2008 9:37 am
Reply with quote

thanks for the info frank,

Quote:
Ask your System Programmer to install that DFSORT PTF (it's free).

will do that icon_lol.gif
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top