Sort question



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sort question

Postby r rudram » Wed Dec 21, 2011 3:20 pm

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!
You do not have the required permissions to view the files attached to this post.
r rudram
 
Posts: 4
Joined: Wed Dec 21, 2011 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort question

Postby BillyBoyo » Wed Dec 21, 2011 3:32 pm

Why is Jane in your output?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort question

Postby enrico-sorichetti » Wed Dec 21, 2011 4:20 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Sort question

Postby enrico-sorichetti » Wed Dec 21, 2011 4:22 pm

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Sort question

Postby BillyBoyo » Wed Dec 21, 2011 4:48 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort question_Matching keys on multiple columns of file

Postby r rudram » Wed Dec 21, 2011 10:51 pm

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.
r rudram
 
Posts: 4
Joined: Wed Dec 21, 2011 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort question

Postby skolusu » Thu Dec 22, 2011 12:03 am

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           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post