Hi , I have two Input files both are results of some scan stuffs. (Input File1: LRECL = 133 / Input File2: LRECL = 120)
The common keys on which ICETOOL should merge the two files are not located in same column positions on both files, (i.e., On the job CPY1 & CPY2 the first 32 bytes /4 = 8 each bytes are the 4 different keys to be matched data (34:23,45,133:X) from FILE1 followed by 80:41,35,120:X) as one record should get listed in OUTREC.
Also, what is the exact usage of, WITHEACH WITH parameter in this context , I know it used for eliminating the duplicates, but not a through understanding on it. The temp file T1 and out file OUT with DD names are of size 133 bytes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Also, what is the exact usage of, WITHEACH WITH parameter in this context , I know it used for eliminating the duplicates, but not a through understanding on it. The temp file T1 and out file OUT with DD names are of size 133 bytes
Why did YOU choose to use WITHEACH if you don't know what it does? The choice to use WITHEACH, WITHALL, WITHANY (new) or none of them depends on exactly what you're trying to do which you haven't explained. However, given that you only have one WITH field, WITHEACH is probably the wrong choice.
If you need more help on this, show an example of the records in each input file (relevant fields only) and what you expect for output. Give the starting position, length and format of each relevant field. Explain the "rules" for getting from input to output.
Keys from Input File 1:CPY2CNTL
-------------------------------
Job Name : (1,8)
Proc Name : (9,8)
Proc Step : (17,8)
DD NAME : (25,8)
TEST DSN : (33,45)
PROD DSN : (79,40)
My requirement is to write outfile with overlaying matching keys (JOB NAME, PROC NAME, DD NAME, PROC STEP) of two input files,
and their corresponding DSN Name on same row. This i need for a task of comparison.
Considering that in JOB TST3060 and ddname SORTIN IS a concertinaed DD. I modified the job as below…
For this modified job, i am getting output good for the matching, but, i still find, only first concatenated dataset displayed, with out FILE2 equivalent,
and for all FILE2 equivalent which still doesn’t have an entry on FILE1 gets into OUTFILE. Please suggest on this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I see several problems.
You don't need WITHEACH since you only have one WITH field. (WITHEACH is for splicing multiple WITH fields one at a time.)
You say you want to match by JOB NAME, PROC NAME, DD NAME, PROC STEP, but you're using ON(1,8,CH) in the SPLICE statement which only matches by JOBNAME. I believe you should be using ON(1,32,CH) to match on the four fields.
Your data for the four fields you want to match on doesn't match for some of the output records you show for file1 and file2. File1 has TST3070K CDATEFILE and file2 has TST3070CDATEFILE so those don't match. File1 has several TST3060E SORTIN values, but File2 has several TST3060SORTIN values which are missing the E. So those records don't match up.
And if you did have the E for the three file2 records, they would all have the same JOB NAME, PROC NAME, DD NAME and PROC STEP values so you couldn't match them one-for-one as you seem to want to do,. It wouldn't be a match for the first one from file1 and the first one from file2, a match for the second one from file1 and the second one from file2, and a match for the third one from file1, and the third one from file2, so each of those pairs could be spliced. It would actually be a match for all 6 records from file1 and file2 so the SPLICE won't do what you want.
If the file1 and file2 records with SORTIN actually have differences in the four fields, then you just have to show me the correct data. If the file1 and file2 records with SORTIN don't have any differences in the four fields, then you need to explain how you want to handle those multiple "matches" (one-by-one from file1 and file2 or some other way).
If you verify that you really want to macth on the four fields, not the one field, and you show me valid matching input records and expected output, and explain what you want to do about the SORTIN records, then I can show you how to do what you want to do. But at the moment, I can't unravel it enough to do that.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
***************************** Top of Data **************************************
SSNNOSDLNONAME1
CMS3060 CMS3060 CMS3060BLOSSES USU#UA.R2.ISO1.CMS.CMSLSDTL(0) "
Hi , Thanks for looking into the issue. Ooops while setting up of the test data, I made the typo errors that you had
mentioned on both files 1 & file 2. Here are the corrected two input files.
Input File 1 (LRECL = 133)
--+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----
***************************** Top of Data **************************************************
UDUAUA.XTEST11.TST.TSTLSDTL(0) " TST3060 JOB3060 TST3060 TST3060B LOSSES
UDUAUA.XTEST11.TST.MTLDTL " TST3060 JOB3060 TST3060 TST3060E SORTIN
UDUAUA.XTEST11.TST.TRAN " TST3060 JOB3060 TST3060 TST3060E SORTIN
UDUAUA.XTEST11.TST3060B.LUALOSS " TST3060 JOB3060 TST3060 TST3060E SORTIN
UDUAUA.XTEST11.INS.LOSSTBL " TST3060 JOB3060 TST3060 TST3060F CRTAFI
UDUAUA.XTEST11.TST.MTLFC(+1) " TST3070 JOB3070 TST3070 TST3070K CDATEFILE
Keys from Input File 1:CPY1CNTL
-------------------------------
DSN NAME : (23,45)
Job Name : (69,8)
Proc Name : (89,8)
Proc Step : (98,8)
DD NAME : (107,8)
Out put file layout
---------------------
Job Name : (1,8)
Proc Name : (9,8)
Proc Step : (17,8)
DD NAME : (25,8)
TEST DSN : (33,45)
PROD DSN : (79,40)
1. The file1 & file2 records in SORTIN, do not have any difference in four key field.
2. I want to handle the multiple matches One-By-One from file1 & file2. (i.e., in case SORTIN the rows 2,3,4 from file1 should exactly match with rows 6,7,8 of file2.
3. As a whole we need to get the output as one-by-one for the matching keys
(JOB NAME, PROC NAME, PROC STEP, DD NAME)
4. Yes, the matching keys should be ON(1,32,CH) as you had mentioned.
For the above three points what changes should be done in ICETOOL SPLICE command and respective control cards to get the required output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
TST3070K CDATEFILE from file1 and TST3070KDATEFILE from file2 still don't match, but I get the idea. Here's a DFSORT/ICETOOL job that will do what you asked for:
thanks to you for your guidance on this task, this time it really worked for me The matching was perfect for same keys (concatenated DD'S).
The RESTART parameter here in CPY1 & CPY2 takes care of breaking the sequence numbering when same keys are encountered, Just wanted to know how this is happening. How the same keys are identified and numbered in a sequence
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I'm glad I could help.
SEQNUM,8,ZD,RESTART=(1,32):
Every time a new value for your 32 byte key is encountered, the sequence number starts over at 1. For the same value, the sequence number increments by 1. Records with unique 32 byte values will each have 1 for the sequence number in each file. But records with duplicate 32 bytes values will have different sequence numbers which will match in each file. For example, for the first SORTIN record in file1 and file2, the sequence number will be 1, for the second SORTIN record in file1 and file2, the sequence number will be 2, etc. Does that help?