How to print records count matched and unmatched in Sortjoin



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

How to print records count matched and unmatched in Sortjoin

Postby sachu1912 » Thu Apr 09, 2015 4:10 pm

Hi,

I have a requirement to print the following details in the existing job.


File1 records read count
File2 records read count
Matched records read count
Unmatched record count only in file1
Unmatched record count only in file2
Number of records written in o/p file.
//File1  DD DSN=XXX
//File2  DD DSN=YYY
//SORTOUT  DD DSN=ZZZ
 JOINKEYS F1=File1,FIELDS=(1,9,A),SORTED,NOSEQCK 
 JOINKEYS F2=File2,FIELDS=(1,9,A),SORTED,NOSEQCK
 JOIN UNPAIRED,F1
 REFORMAT FIELDS=(F1:1,84,F2:14,2,F2:20,2,?)
 OUTREC IFTHEN=(WHEN=(89,1,CH,EQ,C'1'),
                   OVERLAY=(85:X'000C',87:X'000C'))


Please let me know how to do this.

I could see JNF1JMSG and JNF2JMSG does not have matched and unmatched records count and also I need to have these details in file.

Code'd and de-pickled
sachu1912
 
Posts: 7
Joined: Thu Apr 09, 2015 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to print records count matched and unmatched in Sort

Postby NicC » Thu Apr 09, 2015 4:56 pm

When you join a forum please take time to study it carefully before posting. Your question is a sort question, not a JCL question. Moved.
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: How to print records count matched and unmatched in Sort

Postby Terry Heinze » Thu Apr 09, 2015 6:43 pm

Also, in the future, please use Code tags to preserve accurate character spacing.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: How to print records count matched and unmatched in Sort

Postby BillyBoyo » Thu Apr 09, 2015 9:42 pm

If you want to count matches and non-matches, you need to know if there can be duplicates on one or other or both of the files. Because you need to know that, DFSORT doesn't automatically give you want you want (because what it gave you may not be what you want). Have a look here, http://ibmmainframes.com/about58035.html reading through to the answer by Skolusu.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to print records count matched and unmatched in Sort

Postby sachu1912 » Thu Apr 09, 2015 9:57 pm

Yes the thing is whatever I mentioned is an existing job we don't to disturb the existing process and we want to add as a patch to existing job. I have tried with option given by kolusu but I was not able to get it.
sachu1912
 
Posts: 7
Joined: Thu Apr 09, 2015 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to print records count matched and unmatched in Sort

Postby BillyBoyo » Thu Apr 09, 2015 10:20 pm

Can you show what you tried?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to print records count matched and unmatched in Sort

Postby sachu1912 » Fri Apr 10, 2015 1:17 pm

I have tried the below Sort and it had abended with U0016

JOINKEYS F1=XX,FIELDS=(1,9,A),SORTED,NOSEQCK       
JOINKEYS F2=YY,FIELDS=(1,9,A),SORTED,NOSEQCK     
JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,84,                                 
                                       F2:14,2,                                 
                                        F2:20,2, 
                                         ?)
  SORT FIELDS=COPY   
   OUTREC IFTHEN=(WHEN=(89,1,CH,EQ,C'1'),                     
                                                   OVERLAY=(85:X'000C',87:X'000C'),             
   OUTFIL FILES=OUT,TRAILER1=(1:COUNT),REMOVECC,NODETAIL))


Error Details:

             OUTREC IFTHEN=(WHEN=(89,1,CH,EQ,C'1'),                   
             OUTFIL FILES=01,TRAILER1=(1:COUNT),REMOVECC,NODETAIL))   
             $                                                         
 ICE006A 0 OPERAND DEFINER ERROR                                       
 ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685           
 ICE052I 3 END OF DFSORT


Code'd
sachu1912
 
Posts: 7
Joined: Thu Apr 09, 2015 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to print records count matched and unmatched in Sort

Postby BillyBoyo » Fri Apr 10, 2015 2:03 pm

You have a comma at the end of a line, so your OUTFIL is being treated as a continuation. You are also missing a right-parenthesis.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to print records count matched and unmatched in Sort

Postby sachu1912 » Fri Apr 10, 2015 2:09 pm

I have this continuation since I want to count the number of matched records also along with overlay when it satisfies the below condition

OUTREC IFTHEN=(WHEN=(89,1,CH,EQ,C'1')
sachu1912
 
Posts: 7
Joined: Thu Apr 09, 2015 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to print records count matched and unmatched in Sort

Postby BillyBoyo » Fri Apr 10, 2015 3:24 pm

OK, but it doesn't work like that. OUTFIL is entirely separate from OUTREC, or INREC, and that's the end of that story.

So, if you want an OUTFIL to contain only certain records, you use INCLUDE= or OMIT= to specify a condition.

   OUTFIL FILES=OUT,
          INCLUDE=(89,1,CH,EQ,C'1'),
          TRAILER1=(1:COUNT),
          REMOVECC,
          NODETAIL
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post