Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL - JOINKEYS and CNTL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
zh_lad

New User


Joined: 06 Jun 2009
Posts: 91
Location: UK

PostPosted: Thu Jul 31, 2014 8:41 pm    Post subject: JCL - JOINKEYS and CNTL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Jul 31, 2014 8:52 pm    Post subject: Reply to: JCL - JOINKEYS and CNTL
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

New User


Joined: 06 Jun 2009
Posts: 91
Location: UK

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Jul 31, 2014 9:21 pm    Post subject: Reply to: JCL - JOINKEYS and CNTL
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Joinkeys operation betwen VB and FB file Susanta SYNCSORT 4 Sun Sep 25, 2016 9:49 pm
No new posts Joinkeys with duplicated keys juares castro SYNCSORT 19 Fri Sep 23, 2016 5:58 am
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us