IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL - JOINKEYS and CNTL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Thu Jul 31, 2014 8:41 pm
Reply with quote

Hi all,

I have below JCL to do file matching (JOINKEY).

Code:
//MYJOBCRD JOB CLASS=I,MSGLEVEL=1,USER=&SYSUID,NOTIFY=&SYSUID
//S1    EXEC  PGM=ICETOOL                                   
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN DD DISP=SHR,DSN=MY.INPUT.FILE                           
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//OUT1     DD DSN=HLQ.GRPUSHVB.D140729A.F1,                 
//            DISP=(,CATLG),SPACE=(CYL,(2,1))               
//OUT2     DD DSN=HLQ.GRPUSHVB.D140729A.F2,                 
//            DISP=(,CATLG),SPACE=(CYL,(2,1))               
//TOOLIN DD *                                               
COPY FROM(IN) USING(CTL1)                                   
COPY JKFROM USING(CTL2)                                     
/*                                                           
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,8X,5)),                 
  IFTHEN=(WHEN=GROUP,BEGIN=(13,2,ZD,EQ,5),PUSH=(5:ID=8))     
  OUTFIL FNAMES=T1,INCLUDE=(43,3,CH,EQ,C'CAN')               
/*                                                           
//JNF2CNTL DD *                                             
  OPTION COPY                                               
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,8X,5)),               
  IFTHEN=(WHEN=GROUP,BEGIN=(13,2,ZD,EQ,5),PUSH=(5:ID=8))   
/*                                                         
//CTL2CNTL DD *                                           
  JOINKEYS F1=T1,FIELDS=(5,8,A),SORTED,NOSEQCK             
  JOINKEYS F2=IN,FIELDS=(5,8,A),SORTED,NOSEQCK             
  JOIN UNPAIRED,F2                                         
  REFORMAT FIELDS=(F2:1,4,?,F2:13)                         
  OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'B'),BUILD=(1,4,6)
  OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'2'),BUILD=(1,4,6)
/*                                                             

I can not understand when JNF2CNTL will be used in ICETOOL operation.

COPY FROM(IN) USING(CTL1) --> is coded to use CTL1
COPY JKFROM USING(CTL2) --> is coded to use CTL2

What makes SORT to use JNF2CNTL. I thought JKFROM directs SORT to use JNF2CNTL but its description only talks about USING CNTL, which is CTL2CNTL
JKFROM
Specifies you are using a JOINKEYS application with this COPY operator to copy the joined records. You must provide a USING(xxxx) operand. In xxxxCNTL, you must provide a JOINKEYS statement with F1=ddname1 for the F1 file and a JOINKEYS statement with F2=ddname2 for the F2 file, as well as JOIN and REFORMAT statements as needed.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 31, 2014 8:52 pm
Reply with quote

You define the JOINKEYS in the USING(xxxx).

If JNF2CNTL is defined, it will be used in any JOINKEYS operations for the second file.
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Thu Jul 31, 2014 9:13 pm
Reply with quote

Thank you very much.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 31, 2014 9:21 pm
Reply with quote

Also check the manual for use of TASKID on JOINKEYS. It can be necessary, and otherwise may simplify output and aid in understanding.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Sort with JOINKEYS using two VB files DFSORT/ICETOOL 1
No new posts JOINKEYS, how to keep all occurrences? DFSORT/ICETOOL 2
Search our Forums:

Back to Top