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

Simple Splice JCL to get matched records - Need help


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

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Sat Apr 14, 2007 12:41 am
Reply with quote

Hi,
I need to to extract the following from 2 files of same record length.
1) Matched records
2) Records only from file1
3) Records only from file2

I tried the Jcl but getting error:
Code:
ICE027A 9 END OF F1ONLY   FIELD BEYOND MAXIMUM RECORD LENGTH

All the files are FB.

the JCL is given below. pls help
Code:
//IN1 DD *                                         
AAAA 1111 9876 R                                   
BBBB 2222 9876 G                                   
CCCC 3333 8976 T                                   
DDDD 4444 7654 H                                   
/*                                                 
//IN2 DD *                                         
AAAA 1111 9876 R                                   
BBBB 2222 9876 G                                   
WWWW 5555 8976 W                                   
DDDD 4444 7654 H                                   
/*                                                 
//T1 DD DSN=&&T1,UNIT=PRIME,SPACE=(CYL,(1,1),RLSE),
//       DISP=(MOD,PASS)                           
//F1ONLY DD SYSOUT=*                                           
//F2ONLY DD SYSOUT=*                                           
//DUPL DD   SYSOUT=*                                           
//*                                                           
//TOOLIN DD *                                                 
COPY FROM(IN1) TO(T1) USING(CTL1)                             
COPY FROM(IN2) TO(T1) USING(CTL2)                             
SPLICE FROM(T1) TO(DUPL) ON(1,4,CH) -                         
  WITH(1,82) KEEPNODUPS USING(CTL3)                           
/*                                                             
//CTL1CNTL DD *                                               
  INREC OVERLAY=(81:C'BB')                                     
/*                                                             
//CTL2CNTL DD *                                               
  INREC OVERLAY=(81:C'VV')                                     
/*                                                             
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=F1ONLY,INCLUDE=(81,2,CH,EQ,C'BB'),BUILD=(1,80)
  OUTFIL FNAMES=F2ONLY,INCLUDE=(81,2,CH,EQ,C'VV'),BUILD=(1,80)
/*                                                             
//


I know I am doing some simple mistake, but not able to figure out what it is. pls help.
Thanks in advance,
Viji
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Apr 14, 2007 1:07 am
Reply with quote

Well, I see a couple of problems with your job.

1) You're using WITH(1,82) instead of WITH(1,81).

2) You need an OUTFIL statement for DUPL:

Code:

//CTL3CNTL DD *                                               
  OUTFIL FNAMES=DUPL,INCLUDE=(81,2,CH,EQ,C'VB'),BUILD=(1,80)   
  OUTFIL FNAMES=F1ONLY,INCLUDE=(81,2,CH,EQ,C'BB'),BUILD=(1,80)
  OUTFIL FNAMES=F2ONLY,INCLUDE=(81,2,CH,EQ,C'VV'),BUILD=(1,80)


But I think the actual cause of your problem is that your site has changed the IBM shipped default of SOLRF=YES to SOLRF=NO (you can check that by doing an ICETOOL DEFAULTS run). That's really not a good idea.

If that's the case, then adding the following to your job should fix things up:

Code:

//DFSPARM DD *
  OPTION SOLRF
/*
Back to top
View user's profile Send private message
Sagar Mane

New User


Joined: 12 Feb 2007
Posts: 3
Location: Mumbai

PostPosted: Wed Apr 18, 2007 2:56 pm
Reply with quote

Hi Frank,

I need your help on some similar problem that I am facing. Though I can't send the input file record as its too big. My requirement is as follows.
Note: I have added the seperator just to seperate the data. There is no seperator in the actual file.
Input1:
100~ABCDE~12345~01-01-2007
200~ABCDE~64789~01-01-2005
800~ABCDE~11223~01-01-2006

Input2:
100~ABCDE~12345~xxxx~01-01-1975
800~ABCDE~64789~xxxx~01-01-1944
300~ABCDE~11223~xxxx~01-12-1954

Now I want to merge these two files in such a way that the output file will look like this:
ABCDE1234501-01-200701-01-1975
ABCDE6478901-01-200501-01-1944
ABCDE1122301-01-200601-12-1954

Here the last field i.e. the Birth Date from input file2 is merged to input file1. The key for both the input files is 5 chars from 4th position + 5chars from 9th position. eg. Name: ABCDE + Number: 12345.
In my Jcl I have used the Control Card for Input1 as

OUTREC FIELDS=(1:4,10,11:14,10,21:10x).

and for Input2
OUTREC FIELDS=(1:4,10,21:18:10).

But this is not working. Please let me know if any solution
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Apr 18, 2007 8:53 pm
Reply with quote

You should have started a new Topic.

You can use the technique shown in the "Join fields from two files on a key" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

If you need more specific help, tell me the RECFM and LRECL of each input file, and what you want for output in cases where input file1 has a record without a match in input file2, and where input file2 has a record without a match in input file1.
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top