MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

joining records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
k_apsara_1
Beginner


Joined: 01 Apr 2008
Posts: 1
Topics: 1
Location: chennai

PostPosted: Wed Apr 02, 2008 5:06 am    Post subject: joining records Reply with quote

Hi i am facing problem while executing the below jcl.
the is running with maxcc=0.but unable to get the output.
there is no data in my outputfile.

please explain me these commands in detail :
Code:

SPLICE FROM(TMP1) TO(OUT) ON(1,3,CH) WITH(11,5)
OUTREC FIELDS=(1:1,3,5:5,5,11:5X)

as per my example i/p files what with(11,5) contains?

my i/p file1 contains the data:
U155953.JOINFL.FILE1
Code:

000 $$$$$
001 AAAAA
002 CCCCC
003 EEEEE
004 GGGGG

my i/p file2 contains the data
Code:

001 BBBBB
003 DDDDD
004 FFFFF
005 HHHHH

Code:

//U155953R JOB (ACCT#),'APSAR KOGATAM',MSGCLASS=1,MSGLEVEL=(1,1),
//         PRTY=15,NOTIFY=&SYSUID                                 
//DFSORT EXEC PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG DD SYSOUT=*                                             
//IN1 DD DSN=U155953.JOINFL.FILE1,DISP=SHR                       
//IN2 DD DSN=U155953.JOINFL.FILE2,DISP=SHR                       
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD DSN=U155953.JOINFL.OUTPUT,DISP=SHR                       
//TOOLIN DD *                                                     
//*FOR THIS EXAMPLE, THE FIELDS (P,M) ARE AS FOLLOWS:             
//*N1: SORT KEY - 1,3                                             
//*F1FLD - 5,5                                                   
//*IN2: SORT KEY - 1,3                                           
//*F2FLD - 5,5                                                                   
 COPY FROM(IN1) TO(TMP1) USIN(CPY1)                                               
 COPY FROM(IN2) TO(TMP1) USING(CPY2)                             
 SPLICE FROM(TMP1) TO(OUT) ON(1,3,CH) WITH(11,5)                 
/*                                                               
//CPY1CNTL DD *                                                                         
 OUTREC FIELDS=(1:1,3,5:5,5,11:5X)                               
/*                                                               
//CPY2CNTL DD *                                                                       
 OUTREC FIELDS=(1:1,3,11:5,5)                                     
/*

_________________
Apsara.k
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Apr 02, 2008 7:53 am    Post subject: Reply with quote

For a start this is not a JCL question but a sort question so should be in the Utilities section.

Your TOOLIN dataset is empty because of the JCL comment statements that follow it immediately, before your input. You should have a message saying that SYSIN DD statement was generated because non-JCL data was met without a DD * statement immediately preceding it and it is therefore assumed to be SYSIN data.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 02, 2008 12:21 pm    Post subject: Reply with quote

k_apsara_1,

The following DFSORT/ICETOOL JCL will give you the desired results. A brief explanation of the job.

The first copy copies input file1 to temp file T1 padding 5 spaces at pos 11
the second copy operator copies input file2 to temp file T1 copying the contents of pos 5 for a length of 5 bytes to pos 11
The last SPLICE operator sorts on the key (1,3,ch) and if a match is found it combines the 2 records resulting a single records with both the values like shown below

Code:

001 AAAAA BBBBB
003 EEEEE DDDDD
004 GGGGG FFFFF



Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*
//IN1      DD DSN=U155953.JOINFL.FILE1,DISP=SHR                       
//IN2      DD DSN=U155953.JOINFL.FILE2,DISP=SHR                       
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(IN1) USING(CTL1)                                 
  COPY FROM(IN2) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(1,3,CH) WITH(11,5)               
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,OVERLAY=(11:5X)                           
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=T1,OVERLAY=(11:5,5)                           
/*


Please refer the SPLICE examples listed here which explains in detail as to how splice works

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13

Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group