Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Removing duplicates and updating trailer

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

New User


Joined: 07 Jun 2011
Posts: 17
Location: Canada

PostPosted: Tue Jul 19, 2011 8:22 pm    Post subject: Removing duplicates and updating trailer
Reply with quote

Hi

I have an input file with header and trailer. the files has duplicate detail records. I need to remove the duplicates and also I want the trailer to be updated after the duplicates are removed. The key positions are 20 and 79 and the keylength is 8 at both positions. Kindly help

Thanks
Suraj

attachments deleted and content inlined

Code:
1ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
 ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K90026 E9-K60824 C9-BASE   E5-K62149 E7-K65446
 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 14:42 ON TUE JUN 07, 2011 -
0              OPTION COPY
 ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
 ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K90026 E9-K60824 C9-BASE   E5-K62149 E7-K65446
 ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
 ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS
 ICE088I 0 P3MTEST .S1      .        , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=ABEND,MSGDDN=SYSOUT
 ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG
 ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=N,DSA=0
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=0
 ICE235I 0 OPTIONS: NULLOUT=RC0
 ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
 ICE751I 1 EF-BASE   F0-K62422 E8-K61439
 ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE055I 0 INSERT 0, DELETE 0
 ICE054I 0 RECORDS - IN: 1, OUT: 1
 ICE052I 0 END OF DFSORT

Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Jul 19, 2011 8:26 pm    Post subject:
Reply with quote

Firstly, for your example data, please include in bbcode, using the Code button above the input box. Many people cannot download attachments for security reasons, so reducing your chance of getting replies.

Secondly, looking at the names, they both seem to be called version1.txt. Why two the same?

Thirdly, there are many examples here of removing duplicates, have you tried modifying some of those for your requirement?
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jul 19, 2011 9:06 pm    Post subject:
Reply with quote

Quote:
attachments deleted and content inlined

Looks like something got changed while trying to remove attachment. I don't know what OP posted originally but this doesn't look like test data icon_smile.gif

Thanks,
Back to top
View user's profile Send private message
Suraj.Nair

New User


Joined: 07 Jun 2011
Posts: 17
Location: Canada

PostPosted: Tue Jul 19, 2011 9:20 pm    Post subject:
Reply with quote

This is not test data. That was the output to tell which product we are using.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Jul 19, 2011 9:56 pm    Post subject:
Reply with quote

Suraj.Nair wrote:
This is not test data. That was the output to tell which product we are using.

How header and trailer is identified? is there any identifier at header and trailer?

Any identifier on detail lines?

can you please show some sample records.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jul 19, 2011 10:08 pm    Post subject:
Reply with quote

See if below helps... I assumed your key is CH but you can change it to other types. I also assumed Header and Trailer can be identified with HDR and TRL in the first 3 bytes with count starting at 4th position for 8 bytes.

If this doesn't match your requirement please show sample input and expected output.
Code:
//STEP0001 EXEC PGM=SORT                                       
//SORTIN   DD  DISP=SHR,DSN=INPUT FB/100                       
//SORTOUT  DD  SYSOUT=*                                         
//SYSIN    DD  *                                               
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(101:20,8,79,8)),             
       IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),OVERLAY=(101:16C'0')),   
       IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),OVERLAY=(101:16C'9'))   
 SORT FIELDS=(101,16,CH,A),EQUALS                               
 SUM FIELDS=NONE                                               
 OUTFIL BUILD=(1,100),IFTRAIL=(HD=YES,TRLID=(1,3,CH,EQ,C'TRL'),
                        TRLUPD=(4:COUNT=(M11,LENGTH=8)))       
/*                                                             
//SYSOUT   DD  SYSOUT=*                                         

Thanks,
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Tue Jul 19, 2011 10:12 pm    Post subject: Reply to: Removing duplicates and updating trailer
Reply with quote

Quote:
Looks like something got changed while trying to remove attachment. I don't know what OP posted originally but this doesn't look like test data


nothing got changed while removing the attachments
there were two of them with exactly the same content
I deleted them and inlined the content ( ONCE )
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jul 19, 2011 10:58 pm    Post subject:
Reply with quote

enrico-sorichetti,
My apologies, I thought OP provided sample input data which got deleted while removing attachment!!

Thanks,
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 Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us