removing duplicate of second file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

removing duplicate of second file

Postby arya_starc » Thu Dec 22, 2016 9:30 pm

I have two files, in one file I have some inputs which are duplicates in some position and in second file I have some records.
I need records in output file which not contains all that record which present in the second file.

example file 1
001 5827 34
002 5456 24
003 5456 27
004 2463 28
005 2463 25
006 2463 24

file 2

444 1234 23
234 1345 23
234 2463 21


expected output:

001 5827 34
002 5456 24
003 5456 27


As in have only from position 4 to 8 which is having common data in both the files.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: removing duplicate of second file

Postby BillyBoyo » Fri Dec 23, 2016 3:53 am

It's a simple JOINKEYS with the key, specifying JOIN UNPAIRED,F!,ONLY, you'll need to also SORT in the maintask to get the data back into your original key order (001/002/003).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: removing duplicate of second file

Postby arya_starc » Sat Dec 24, 2016 3:45 pm

BillyBoyo wrote:It's a simple JOINKEYS with the key, specifying JOIN UNPAIRED,F!,ONLY, you'll need to also SORT in the maintask to get the data back into your original key order (001/002/003).


Hi BillyBoyo
Thanks for giving info

I tried with unpaired joined and keeping f1 file only, on running it will give the return code 16. Below is the code

000028   SORT FIELDS=COPY                      
000029   JOINKEYS FILE=F1,FIELDS=(20,19,A)      
000030   JOINKEYS FILE=F2,FIELDS=(20,19,A)      
000031   JOIN UNPAIRED,F1,F2                    
000032   REFORMAT FIELDS=(F1:1,16104)          
 


getting this error message code


ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2                  
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=16104                                  
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1                          
ICE805I 1 JOBNAME: JTHTEZT1 , STEPNAME: STEP020                                
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                    
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R1  - 17:12 ON SAT DE
            SORT FIELDS=COPY                                                    
            JOINKEYS FILE=F1,FIELDS=(20,19,A)                                  
            JOINKEYS FILE=F2,FIELDS=(20,19,A)                                  
            JOIN UNPAIRED,F1,F2                                                
            REFORMAT FIELDS=(F1:1,16104)                                        
ICE043A 8 INVALID DATA SET ATTRIBUTES: SORTOUT  BLKSIZE - REASON CODE IS 06    
ICE751I 0 C5-I21470 C6-BASE   C7-K96411 C8-I25275 E7-I22412                    
ICE052I 3 END OF DFSORT                                                        
 
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: removing duplicate of second file

Postby NicC » Sat Dec 24, 2016 7:42 pm

What have you tried to in order to fix this? What is the JCL for the SORTOUT DD statement?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: removing duplicate of second file

Postby arya_starc » Mon Jan 02, 2017 5:44 am

Thanks guys,

Now it is working. Below is the code.

000098 //SYSIN    DD  *                                                        
000099   SORT FIELDS=COPY                                                      
000100   JOINKEYS FILES=F1,FIELDS=(15,24,A)                                    
000101   JOINKEYS FILES=F2,FIELDS=(1,24,A)                                    
000102   JOIN UNPAIRED,F1,ONLY    
 

previously might be I using join and reformat at a same time.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post