Compare two ps to find out the uncommon record



IBM's Command List programming language & Restructured Extended Executor

Compare two ps to find out the uncommon record

Postby kuldeep negi » Wed May 20, 2009 1:27 pm

i have two PS files and i want to compare them to find out the uncommon record between them using rexx.

can any one suggest me the rexx code for the same????

Thanks a loot in advance.
kuldeep negi
 
Posts: 21
Joined: Mon Apr 27, 2009 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two ps

Postby MrSpock » Wed May 20, 2009 4:05 pm

With all of the other tools that do this better (SUPERC or SORT), why REXX? Anyway, if you do have to use REXX, what's the process (i.e. the algorithm) you plan on using?
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: compare two ps

Postby kuldeep negi » Wed May 20, 2009 4:14 pm

i have two PS files :
FIle A: LRECL(42) FB

CL12009030000005100000000015281717D0000R01
CL12009030000005100000000025281741G0000R01
CL12009030000009400000000010435662D0511J00
CL12009030000011600000000015794376A0000R01
CL12009030000011600000000026823751{0000R01

similarly it contains multiple records

FIle B: LRECL(205) FB

CL12009030000001900000000010000001I12001 000 46421681 40690839
CL12009030000002900000000010000002I12001 000 00 40690866
CL12009030000004500000000010000004E12001 000 00 40702932
CL12009030000005100000000010000005A12001 000 00 40706222
CL12009030000007800000000010000007H12001 000 69190273 40706249

similarly it contains multiple records

I want to compare these two files and to find out the uncommon record between them ..
kuldeep negi
 
Posts: 21
Joined: Mon Apr 27, 2009 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two ps

Postby kuldeep negi » Wed May 20, 2009 4:16 pm

one more thing the key starts from 28th position and the length of the key is 8
kuldeep negi
 
Posts: 21
Joined: Mon Apr 27, 2009 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two ps

Postby dick scherrer » Wed May 20, 2009 11:49 pm

Hello,

To repeat - this is not a job for rexx.

Your sort product is a better choice to do what you want to do.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Compare two ps to find out the uncommon record

Postby rahul2825 » Fri May 29, 2009 8:43 pm

hi you can even file -aid for the same to compare 2 ps files and get uncommon recs.

in the control card u give the keys to be compared i have done this some 3 years back so i couldnt recall.
//MP07U194 EXEC PGM=FILEAID,REGION=6M
//STEPLIB DD DISP=SHR,DSN=SYS1.FILEAID.LOAD
//SYSPRINT DD SYSOUT=&SYSOT
//SYSLIST DD SYSOUT=&SYSOT,DCB=(LRECL=183,BLKSIZE=1830)
//*
//DD01 DD DSN=file1
//DD01C DD DSN=file2
//* DUPLICATES ON HISTORY
//*
//DD01CO1 DD DSN=file3,DISP=(,CATLG),
// DCB=(RECFM=FB,LRECL=90,BLKSIZE=27000),
// SPACE=(27000,(15000,100),RLSE),UNIT=DISK
//*
//DD01CP DD DSN=(control card1 where u will put compare options),DISP=SHR
//*
//SYSIN DD DSN=(controlcard2),DISP=SHR
//*

u can give in control card the which is generated by the fileaid as below (u need to give fields positons and all that)

* control card1
* COMPARE OPTIONS
0000 COMPARE_MODE=UNFORMATTED
0000 COMPARE_TYPE=SORTED
0000 RECORDS_TO_COMPARE=ALL
0000 DIFFERENCES_TO_COMPARE=ALL
*
* PRINT OPTIONS
0000 PRINT_FORMAT=CHAR
0000 MAX_DIFFERENCES_TO_REPORT=ALL
0000 RECORD_TYPES_TO_PRINT=CHANGED,DELETED,INSERTED
0000 UNFORMATTED_REPORT_STYLE=CONDENSED
0000 UNFORMATTED_PRINT_SEQUENCE=GROUP
0000 CHANGED_RECORD_PRINT_CONTENT=RECORD
0000 INSERTED_RECORD_PRINT_CONTENT=RECORD
0000 DELETED_RECORD_PRINT_CONTENT=RECORD
0000 MATCHED_RECORD_PRINT_CONTENT=RECORD
0000 CONDENSED_REPORT_PRINT_ONLY_CHANGED_DATA=NO
0000 CONDENSED_REPORT_UNDERLINE_CHANGES=BOTH
0000 CONDENSED_REPORT_UNDERLINE_SYNC/KEY=BOTH
0000 CONDENSED_REPORT_SUPPRESS_PRINT_WITHOUT_CHANGES=YES
0000 CONDENSED_REPORT_PRINT_RULER=TOP
0000 CONDENSED_REPORT_CHANGED_DATA_UNDERLINE_CHARACTER=_
0000 CONDENSED_REPORT_SYNC/KEY_UNDERLINE_CHARACTER=
*
* OUTPUT OPTIONS
0000 WRITE_TO_FILE_1=OLD/DELETED
0000 WRITE_TO_FILE_1=NEW/INSERTED
*
* SYNC/KEY OPTIONS
0000 SYNC/KEY001:OLD_POSITION=00001,OLD_LENGTH=00002,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00001,NEW_LENGTH=00002,NEW_DATA_TYPE=C
0000 SYNC/KEY002:OLD_POSITION=00003,OLD_LENGTH=00004,OLD_DATA_TYPE=C,
0000 SYNC/KEY002:OLD_POSITION=00003,OLD_LENGTH=00004,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00003,NEW_LENGTH=00004,NEW_DATA_TYPE=C
0000 SYNC/KEY003:OLD_POSITION=00007,OLD_LENGTH=00016,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00007,NEW_LENGTH=00016,NEW_DATA_TYPE=C
0000 SYNC/KEY004:OLD_POSITION=00023,OLD_LENGTH=00016,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00023,NEW_LENGTH=00016,NEW_DATA_TYPE=C
0000 SYNC/KEY005:OLD_POSITION=00039,OLD_LENGTH=00015,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00039,NEW_LENGTH=00015,NEW_DATA_TYPE=C
0000 SYNC/KEY006:OLD_POSITION=00054,OLD_LENGTH=00006,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00054,NEW_LENGTH=00006,NEW_DATA_TYPE=C
0000 SYNC/KEY007:OLD_POSITION=00060,OLD_LENGTH=00007,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00060,NEW_LENGTH=00007,NEW_DATA_TYPE=C
0000 SYNC/KEY008:OLD_POSITION=00081,OLD_LENGTH=00001,OLD_DATA_TYPE=C,
SORTED=YES,SEQUENCE=ASCENDING,
NEW_POSITION=00081,NEW_LENGTH=00001,NEW_DATA_TYPE=C
*
* COMPARE FIELDS SET 0001

control card 2
000001 $$DD01 COMPARE
rahul2825
 
Posts: 12
Joined: Tue Mar 31, 2009 3:40 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post