I'm having some difficulty with the Splice operator. I don't seem to be getting the results I want. I've included a few sample rows of my data that get concatenated in DD FILEIN and the ICETOOL statements I'm using.
Ultimately, I'd get the record from Dataset 1 and the matching record's columns 18-29 from Dataset 2. Worst case would be Dataset 1 record and the entire matching Dataset 2 record on one row as shown above.
What am I doing wrong? I've reviewed the ICETOOL Mini-User Guide from Dec 2004 and been through some of the previous posts, but still can't quite get the process to work as I want. Can it? Thanks in advance for any clarification.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I can't tell what your data really looks like ... if there are blanks, they've been removed. I don't think you have all of the data starting in position 1 for both files or you wouldn't have gotten the output you say you got.
You need to reformat the records so that the WITH data from input file2 is where you want it to be in the output file. I'd suggest reading through the discussion of SPLICE in "z/OS DFSORT Application Programming Guide" carefully. Here's a link to that discussion:
Just to give an example, I'll assume that the data in both files starts at position 1. Here's the DFSORT/ICETOOL job you'd need. I assumed your input files had RECFM=FB and LRECL=26, but the job can be changed appropriately for other attributes.
Apart from what frank has told one reason may be that you are using
the same input file twice since the data in the output file for both the
input looks the same. Am not sure but this might be another reason
for the incorrect output.
Thanks for the help. Both my files were 29 byte records in the same layout. I was able to take the sample code and modify it ever so slightly to accomodate the bigger record size and it appears to be working based on initial testing. And I'm definitely adding the link you provided to my documentation stash. Thanks again!