View previous topic :: View next topic
|
Author |
Message |
Chirag Dhull
New User
Joined: 29 Aug 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi ,
I have a File A with LRECL of 5300, First my program Takes that File and sorts it on (487,17,CH,A) and removes all Duplicate Record Entries , Lets Call this O/P File : File AwithoutDups.
Now it Picks the File A again and Just sorts it with (487,17,CH,A) and does not remove duplicate record entries . Lets Call the O/p File :
File AwithDups
Now it Does a comparex of files AwithoutDups and AwithDups to catch all the Duplicate records in the O/p file (Lrecl 5300) . Sysin for Comparex is "COPYDIFF
KEY=(487,17,,A)
FORMAT=13
PRINT=(MATCH,MISMATCH)"
To make it more Clear .
E.g - File A has Records
xyz 345678
abc 234567
def 123456
xyz 345678
abc 234567
xyz 345678
so after sortin on (5,6) and removin dups it is :
File Awithoutdups :-
def 123456
abc 234567
xyz 345678
and File AwithDups is :-
def 123456
abc 234567
abc 234567
xyz 345678
xyz 345678
xyz 345678
Now doin a Comparex on (5,6) on these two gives me the duplicate entries
abc 234567
xyz 345678
xyz 345678
Please tell me how to acheive this widout comparex |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
Back to top |
|
|
Chirag Dhull
New User
Joined: 29 Aug 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi
Actually i tried implementing that but it throws maxcc=16 with
MODE IN EFFECT: STOP
SORT FROM(SYSUT1) USING(CTL1)
DFSORT CALL 0001 FOR SORT FROM SYSUT1 TO OUTFIL USING CTL1CNTL
OPERATION RETURN CODE: 16
MODE IN EFFECT: SCAN
SORT FROM(SYSUT2) USING(CTL1)
NO ERRORS FOUND IN STATEMENT
SELECT FROM(TEMP) TO(SYSUT3) ON(1,5308,CH) NODUPS USING(CTL2)
INVALID LENGTH, FORMAT, OR COMBINATION FOR SELECT OPERATION
DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 16
Could you please let me know for the key (487,17) and lrecl 5300 . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post the jcl/control statements you used that failed.
When you post error info, you should also include the message numbers (ICExxx).
All of this is best posted using the "Code" tag for readability. Use Preview to see your post the way the forum will se it rather than how it appears n the Reply editor.
Why do you specify 5308 for a record with lrecl of 5300? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Chirag Dhull,
You comparex job is comparing only 17 bytes which start at pos 487. why are you are comparing the entire 5308 bytes in DFSORT? The maximum length you can use for ON fields for character data is 1500.
I re-read your initial post once again and I see that you ONLY have 1 file and all you want is to find duplicates. But your description is completely off.
First you eliminate duplicated records based on the key at pos 487 for a length of 17 bytes and now you want to compare those records against field at pos 5 for 6 bytes? It does not even make sense.
Based on my assumption here is a DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
SORT FIELDS=(487,17,CH,A)
OUTREC OVERLAY=(5301:SEQNUM,8,ZD,RESTART=(487,17))
OUTFIL INCLUDE=(5301,8,ZD,GT,1),BUILD=(1,5300)
/* |
Hope this helps....
Cheers |
|
Back to top |
|
|
Chirag Dhull
New User
Joined: 29 Aug 2008 Posts: 8 Location: Bangalore
|
|
|
|
This works !!! thanks mate |
|
Back to top |
|
|
|