Compare column and write non matched records to output.

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Compare column and write non matched records to output.

Post by alpna »

I want to copy only the records where the value in column 2 is not equal to the value in column 3 :

Code: Select all

111 AAAAA   AAAAA    
222 AAAAA   BANANA  
333 BBBBBB  BBBBBB  
444 CCCCC   CCCCC    
555 DDDD    AAAAA 
How can I do that. I could not find a way of doing it in file-iad, perhaps can do it in sort. Thanks for any help.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Compare column and write non matched records to output.

Post by William Collins »

If the data is in a fixed position as you have shown, with a COPY operation and an INCLUDE COND=(5,8,CH,EQ,13,8,CH) (check the starts and lengths).

If the columns are in variable positions, you'd have to PARSE them and put them in fixed positions, and then use INCLUDE= on OUTFIL.
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Re: Compare column and write non matched records to output.

Post by alpna »

William Collins wrote:If the data is in a fixed position as you have shown, with a COPY operation and an INCLUDE COND=(5,8,CH,EQ,13,8,CH) (check the starts and lengths).
Thank you William. This helped me to achieve what I wanted.

Thanks! :good:
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”