Extract the Matching Records



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Extract the Matching Records

Postby fornanthakumar » Thu Feb 17, 2011 3:49 pm

Hi,

I need to compare two file records and get the matching records based on the columns.Here is the input sample

INPUT FILE1
- -- -+ -- --1- - -- + - -- -2 - - - -+---
2344567890NANTHUSOUTHAFRICA
1244567890MUKILAINDIA
1244567890BREYANUNITEDSTATES
1234567890DONALDAUSTRALIA

INPUT FILE2
- -- -+ -- --1- - -- + - -- -2 - - - -+---
2134567890NANTHU
4544567890MUKILA
4564567890BREYAN
1234567890DONALD

I have done in option 3.13 , i have mentioned the columns like below
CMPCOLM 6:4 6:4
CMPCOLM 11:6 11:6

i got all the records are mismatched but according to the column all the values are matched na.. 3.13 option considered the whole record but i want to consider only the column and no matter what ever the record values are ...

could you please any one tell me, how to compare only the column values..
Regards,
Nanthu.Y.
fornanthakumar
 
Posts: 69
Joined: Fri Oct 22, 2010 1:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extract the Matching Records

Postby NicC » Thu Feb 17, 2011 3:58 pm

From the manual...
CMPCOLM Applies to the columns in both the new (or search) data set and old data set
CMPCOLMN Applies to the columns only in the new data set
CMPCOLMO Applies to the columns only in the old data set.


Are you using the correct keyword?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Extract the Matching Records

Postby fornanthakumar » Mon Feb 21, 2011 7:59 pm

Records in File 1 :

1234567890
2345678901
1235789000

Records in File 2 :

1234567890
2345678902
1235467890

I want the output like

1234567890
1235467890
1235789000

It means i have just compared two file columns from position 1 to 4. I dont mind other character from position 5 to 80.

But if i use any CMPCOLM,CMPCOLMN,CMPCOLMO.. this wil check other characters from position 5 to 80. It means giving output like

1234567890

it will not consider below records though the column values from position 1 to 4 are same.
1235467890 -- FILEB
1235789000 -- FILEA

Please advice if there is any chances.
Regards,
Nanthu.Y.
fornanthakumar
 
Posts: 69
Joined: Fri Oct 22, 2010 1:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extract the Matching Records

Postby fornanthakumar » Mon Feb 21, 2011 8:00 pm

Records in File 1 :

1234567890
1834567133
1235789000

Records in File 2 :

1234567890
2345678902
1235467890

Please consider this as input file for the above reply.. apologies.
Regards,
Nanthu.Y.
fornanthakumar
 
Posts: 69
Joined: Fri Oct 22, 2010 1:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extract the Matching Records

Postby NicC » Mon Feb 21, 2011 8:31 pm

Suggest you read all about CMPCOLMx and note that you specify which columns to compare.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Extract the Matching Records

Postby expat » Tue Feb 22, 2011 1:18 pm

Or maybe look at the functionality of your SORT product.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post