Page 1 of 1

Sort question

PostPosted: Wed Dec 21, 2011 3:20 pm
by r rudram
Hello,

I have a 3700 byte data file as follows (File A) and a VSAM lookup file (File B) - 1000 bytes. File B has the key field in column 1-11.

The rules -

The lookup file B will be used to read File A, and if there is a match of the File B key in File A, I will need to eliminate those records alone from A.
File A can contain these key values in multiple (specific) columns within the same record. I need to scan for the presence of these key values in those columns and reject the records with a matching key (dump to file) and retain the unmatched ones from File A in its entirety with no change to file structure.

File A can contain spaces for the columns being validated.

Examples provided below - (See attached spreadsheet if alignment problems in the post)

Input file A - Several columns omitted below for illustration only, does not depict all columns of File A, also a few more columns can contain the dups, not shown here.

Prod# Name CODE(1) CODE(2) CODE(3) CODE(4)
(Pos 200:11) (Pos 300:20) (Pos 500:11) (Pos 600:11) (Pos 700:11) (Pos 800:11)
00179009330 Smith 00453405343 00179009330 00984323443
00179102650 John 00179102650 00356877555
00587656755 Doe 00179195730 00656566454
55587656700 Smith 00179195732 00656566454 00179009330
00485758655 Alice 00643343333 00000000222 00444443333 00775857575
00179009330 Jane 00656566453 00000000222

Lookup File (File B) - Keys 1:11

00179009330 68865474940494 FSDDFGLL OOODDDDDDDDDD
00179102650 30062775537799 XYZABC SMITH ABCDEFFFFFFF
00656566453 64996600884844 DOE JANE
00656566454 64996600884844 DOE JOHN

Output File (Unmatched)
Prod# Name CODE(1) CODE(2) CODE(3) CODE(4)
00485758655 Alice 00643343333 00000000222 00444443333 00775857575
00179009330 Jane 00656566453 00000000222

Rejected records (Matched)

Prod# Name CODE(1) CODE(2) CODE(3) CODE(4)
(Pos 200:11) (Pos 300:20) (Pos 500:11) (Pos 600:11) (Pos 700:11) (Pos 800:11)
00179009330 Smith 00453405343 00179009330 00984323443
00179102650 John 00179102650 00356877555
00587656755 Doe 00179195730 00656566454
55587656700 Smith 00179195732 00656566454 00179009330

Is there any way I could use splice for this or any other method with ICETOOL? Any pointers are appreciated!

Thank you!

Re: Sort question

PostPosted: Wed Dec 21, 2011 3:32 pm
by BillyBoyo
Why is Jane in your output?

Re: Sort question

PostPosted: Wed Dec 21, 2011 4:20 pm
by enrico-sorichetti
it would be better to use a more intelligent title,
a poor title usually implies carelessness and a poor question
people willing to answer will most usually skip such topics

Re: Sort question

PostPosted: Wed Dec 21, 2011 4:22 pm
by enrico-sorichetti
OK You asked for it!
Why is Jane in your output?

IMHO the problem is not Jane being there, it' s TARZAN that' s missing :geek:

Re: Sort question

PostPosted: Wed Dec 21, 2011 4:48 pm
by BillyBoyo
enrico-sorichetti wrote:OK You asked for it!
Why is Jane in your output?

IMHO the problem is not Jane being there, it' s TARZAN that' s missing :geek:


Yes, I produced a very good example of a thoughtlessly-worded question :-)

A better attempt.

Why is your second output record included in the output, when it not only matches the reference file but matches it with two different values, or is this an implicit part of the logic, in which case please make it explicit?

Re: Sort question_Matching keys on multiple columns of file

PostPosted: Wed Dec 21, 2011 10:51 pm
by r rudram
My apologies - The second record in the output file should have been shown in the "matched" file.
Thank you for pointing to the subject line- I've revised it to something more meaningful.

Re: Sort question

PostPosted: Thu Dec 22, 2011 12:03 am
by skolusu
r rudram,

It is NOT clear as to what the output is. If I understand you correctly, your vsam key needs to be looked in 5 places of the input file Prod#,CODE(1),CODE(2),CODE(3),CODE(4). if it is found in any of these values then reject that record or else write the record as is to unmatched file from fileA

Post a better examples of input and output and also run the following job and show us the complete sysout which will help us determine the level of DFSORT you have

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *             
//SORTOUT  DD SYSOUT=*       
//SYSIN    DD *             
  SORT FIELDS=COPY           
//*