Posted: Mon Feb 12, 2007 9:49 am Post subject: Using Sections, Trailer to eliminate duplicate and get count
Hello gurus
My infile is of length 12735. I need an output file of length 12739 (Infile + Count of duplicates). My job should give me one record for duplicates (SUM FILEDS=NONE) and the count of duplicates. I am using below job but it fails with error:
Quote:
Error Message:
TRAILER3=(1,12735,X,COUNT=(M11,LENGTH=3)))
$
ICE223A F REPORT FIELD ERROR
I then analysed the error and changed the code to
Quote:
TRAILER3=(1,256,X,COUNT=(M11,LENGTH=3)))
.
It ran with maxcc=0 but it gave an outfile of 12735 (with 256 byte data from infile and also without my duplicate count).
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Mon Feb 12, 2007 10:37 am Post subject:
Naveen_summary,
The first error is because you cannot specify more than 256 bytes on the header/trailer parms. ie trailer1=(p,m) P specifies the position and m specifies the length in bytes of the input field. The value for m must be between 1 and 256.
If your intention is just find the count of duplicate records, try these control cards
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Feb 12, 2007 12:59 pm Post subject:
Kolusu,
Yes, DFSORT's SELECT supports INREC processing. But using INREC that way with SPLICE would only work correctly if the records were already in sorted order, which we don't know to be the case here. Remember that INREC is processed before SELECT. If the records weren't in sorted order, then we wouldn't get the correct count from RESTART since it starts over at 1 each time the key changes. For example, the count might be as follows:
A 1
B 1
B 2
A 1
A 2
B 1
B 2
so the last "count" for A would be 2 instead of 3 and the last count for B would be 2 instead of 4.
That's why the extra SORT operator with OUTREC (processed after SORT) is needed. If we sort the records first, RESTART gives us the count we want:
A 1
A 2
A 3
B 1
B 2
B 3
B 4 _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Feb 12, 2007 3:23 pm Post subject:
Nothing to be sorry about. I started out thinking I could do what you said; it took me a while to figure out I couldn't. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 13 Oct 2005 Posts: 84 Topics: 32 Location: INDIA
Posted: Sat Mar 17, 2007 12:25 am Post subject:
Frank/Kolusu,
when i try above code , getting following error message,
IS my shop doesn't support ICETOOL? can you please help me.
below is the jcl
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
11 AA BB 00
22 XX CC 12
11 AA BB 00
22 XX CC 12
33 BB DD 12
11 AA 00
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,80,CH) LAST
//CTL1CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,80,CH,A)
OUTREC OVERLAY=(80:SEQNUM,3,ZD,RESTART=(1,80))
/*
below is the job log
Code:
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 22:20 ON FRI MAR
OPTION EQUALS
SORT FIELDS=(1,80,CH,A)
OUTREC OVERLAY=(80:SEQNUM,3,ZD,RESTART=(1,80))
$
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION LIST,MSGPRT=ALL,MSGDDN=DFSMSG,RESINV=0,SORTDD=CTL1,SORTIN=IN,SO
TOUT=T1,DYNALLOC
ICE012A 3 MISSING FIELDS OPERAND DEFINER
ICE052I 3 END OF DFSORT
******************************** BOTTOM OF DATA ********************************
********************************* TOP OF DATA **********************************
ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN
ICE630I 0 MODE IN EFFECT: STOP
SORT FROM(IN) TO(T1) USING(CTL1)
ICE606I 0 DFSORT CALL 0001 FOR SORT FROM IN TO T1 USING CTL1CNTL TER
ICE602I 0 OPERATION RETURN CODE: 16
ICE630I 2 MODE IN EFFECT: SCAN
SELECT FROM(T1) TO(OUT) ON(1,80,CH) LAST
ICE612I 0 NO ERRORS FOUND IN STATEMENT
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Sat Mar 17, 2007 9:12 am Post subject:
If you did not have ICETOOL you would not be getting ICETOOL meassages - your job would abend with load module not found. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Sat Mar 17, 2007 10:04 am Post subject:
js01n
Yes, you have DFSORT's ICETOOL (ifyou have DFSORT, you have DFSORT's ICETOOL). The error indicates you don't have the Dec, 2004 DFSORT PTF which is required for OVERLAY. So your site is quite far behind on DFSORT service. Ask your system programmer to install DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the available DFSORT/ICETOOL function. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum