Page 1 of 2

Need jcl to take unmatched records count to store in dataset

PostPosted: Thu Apr 05, 2012 12:10 pm
by deva_048
Am using sync sort want to compare two datasets to store result in new dataset
Dataset1:contains field contains length 3
Dataset2:contains field contains length 3

DS1:
1,308,aaaa
1,308,aaaa
1,308,aaaa
2,309,cccc
2,309,cccc
2,309,cccc
2,309,cccc

DS2:
1,308,aaaa
1,308,aaaa
2,309,cccc
2,309,cccc

I have taken the count for two datasets:
SORT FIELDS=COPY                           
 OUTFIL FNAMES=OUTPUTF1,REMOVECC,NODETAIL, 
        INCLUDE=(3,3,CH,EQ,C'308'),
TRAILER1=(1C'RECORD COUNT: ',COUNT=(M11,LENGTH=20))

OUTFIL FNAMES=OUTPUTF1,REMOVECC,NODETAIL, 
        INCLUDE=(3,3,CH,EQ,C'309'),
TRAILER1=(1C'RECORD COUNT: ',COUNT=(M11,LENGTH=20))


DS1:
Record count for 308 is 3
Record count for 309 is 4

DS2:
Record count for 308 is 2
Record count for 309 is 2

My requirement to take unmatched count to store in new dataset need jcl
ie)whole row for 308 remaining 1 record and for 309 remaining two records to store in new dataset. Please help me.Thanks in advance.

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 12:48 pm
by deva_048
Output should be :
1,308,aaaa
2,309,cccc
2,309,cccc

It has to be store into new dataset

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 1:07 pm
by bodatrinadh
Deva,

What SYNCSORT version you are using ? On what key fields you want to compare?

You did not replied to my question in your previous post.

syncsort-synctool/topic7409-30.html
Subject :- Have to compare two datasets with Syncsort --- Whether this has resolved?


Thanks
-3nadh

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 1:14 pm
by deva_048
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSORT INC.
SYNCSORT R132/ZOS INSTALLED 2009 z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 12AF4, MODEL 2097 502

Not yet resolved. IN (3,3) position which mentioned in above posted list

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 1:28 pm
by bodatrinadh
I guess SYNCSORT FOR Z/OS 1.3.2.1R won't support sub tasks.

You can try this code..

//STEP1    EXEC PGM=SORT                           
//SORTJNF1 DD *                                     
1,308,AAAA                                         
1,308,AAAA                                         
1,308,AAAA                                         
2,309,CCCC                                         
2,309,CCCC                                         
2,309,CCCC                                         
2,309,CCCC                                         
//SORTJNF2 DD *                                     
1,308,AAAA                                         
1,308,AAAA                                         
2,309,CCCC                                         
2,309,CCCC                                         
//SORTOUT  DD  SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SYSOUT  DD SYSOUT=*                               
//JNF1CNTL DD *                                     
  INREC OVERLAY=(51:SEQNUM,8,ZD,RESTART=(1,10))     
//JNF2CNTL DD *                                 
  INREC OVERLAY=(51:SEQNUM,8,ZD,RESTART=(1,10))
//SYSIN DD *                                   
  JOINKEYS FILE=F1,FIELDS=(1,10,A,51,8,A)       
  JOINKEYS FILE=F2,FIELDS=(1,10,A,51,8,A)       
  JOIN UNPAIRED,F1,ONLY                         
  SORT FIELDS=COPY           
  OUTFIL BUILD=(1,10,70X)


Your Output :-
1,308,AAAA 
2,309,CCCC 
2,309,CCCC 


Note :- Tested on SYNCSORT FOR Z/OS 1.4.0.1R
If it is not working in your syncsort version, switch it to ICETOOL.
Thanks
-3nadh

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 1:55 pm
by bodatrinadh
Except for OUTFIL, please change all (1,10) to (3,3) as you mentioned in your post.

Thanks
-3nadh

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 3:04 pm
by deva_048
am not getting the sortout step in spool but rc=0

--RC--PGM--------STEP-----PRSTEP---PROC---
   0  SORT       STEP1                   
--------DDNAME---STEP-----PRSTEP---STAT-AC
_    1  LOG      *                       
_    2  JCL      *                       
_    3  MESSAGES *                       
_    4  SYSOUT   STEP1     

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 3:07 pm
by deva_048
where i need to change (3,3). Are you telling in your posted code need to change or where

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 3:19 pm
by BillyBoyo
bodatrinadh wrote:I guess SYNCSORT FOR Z/OS 1.3.2.1R won't support sub tasks.

[...]

Note :- Tested on SYNCSORT FOR Z/OS 1.4.0.1R
If it is not working in your syncsort version, switch it to ICETOOL.
Thanks
-3nadh


Sort each of your input files on 1,10,A, doing the sequence numbering on OUTREC.

Then run your JOINKEYS step with the new inputs. Add ",SORTED" to each of the JOINKEYS statements.

Re: Need jcl to take unmatched records count to store in dat

PostPosted: Thu Apr 05, 2012 3:31 pm
by deva_048
will u please resubmit the jcl what need to do?