Posted: Mon Oct 17, 2011 10:50 pm Post subject: Create files with matching and non matching records- SPLICE?
I've been reading up on the use of the SPLICE operator in ICETOOL and to be honest, I'm struggling a little with it. I have 2 input datasets, I want to compare one dataset with the other and output all records that have specific strings in both datasets to a 'Matching' dataset and the records that do not match, to a 'Not Matching' dataset.
Here's a sample of the INPUT datasets (we'll call them input1 and input2 for now).
Both datasets are have the same record lenght (266), with the output datasets also needing to be 266. The fields I need to compare on start in column 1 for 20 in the input1 dataset, and column 61 for 20 in the input2 dataset (the 'ESS26000,YPAT,G03794' string for example)
If a string within these column boundaries appears in both input dataset, I want to output columns 1 to 33 from the input1 dataset and columns 61 to 266 from the input2 dataset into a the 'Matching' dataset.
If the string within these column boundaries appears does not appear in both datasets, then I want to output columns 1 to 266 from the input dataset when the unmatched string resides.
Maybe a fresh start tomorrow will help me sort this myself, but right now I feel like I've gone cross eye'd!
I'd show you how to do what you want with JOINKEYS, but I can't really figure out what you want from your description and examples. You say you want to compare 1-20 in input1 with 61-20 input2 but those don't seem to match (e.g. 02:02:41 vs ESS26000,YPAT,G03794).
If you need more specific help, you need to explain more clearly what you're trying to do. Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. _________________ Frank Yaeger - DFSORT Development Team (IBM) - email@example.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Thanks Frank, I'd spotted the JOINKEYS function earlier in the day yesterday, but wasn't sure what was best to use (SPLICE or JOINKEYS). I'd really appreciate it if you could show me how to do what I need using JOINKEYS. As requested, here is a more details description of what I'm trying to do (please let me know if this isn't clear enough).
Here's an example from my INPUT1 file of the field I want to compare with my INPUT2 file. The start position is 14 for 20 CH (EBCDIC characters).
All datasets (input and output) are the same RECFB=FB and LRECL=266.
If any of the records from the input1 dataset (start pos 14 for 20) match ANY of the records from the input2 dataset (start pos 61 for 20) then I want to output from start pos 1 for 33 from the input1 dataset record and start pos 82 for 80 from the input2 dataset record to an output dataset called 'matched' (a single output record, not two output records).
Any unmatched/unpaired records from the input1 dataset (start pos 14 for 20) need to be output from start pos 1 for 33 from the input1 dataset record to an output dataset called 'nomatch1'
Any unmatched/unpaired records from the input2 dataset (start pos 61 for 20) need to be output from start pos 82 for 80 from the input2 dataset record to an output dataset called 'nomatch2'
Here are 4 sample records from start pos 1 for 33 from the input1 dataset.
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