Last active
April 27, 2016 06:02
-
-
Save radzhome/7d99de5393ee3c77dcc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* rexx */ | |
/* LMP KEY Duplicates Summary*/ | |
/* August 2008, functional comparisons working */ | |
/* Input file has to be unnummed, use unnum on file before running */ | |
/******************************* | |
/* SAME PROD CODE AND xxx! */ | |
/******************************* | |
INDSN="PS0601.CACOMMON.ALL.PPOPTION(KEYS)" | |
CALL Initialize | |
/* main loop */ | |
do while Done=0 | |
CALL ReadRecord | |
END | |
/*do x = 1 to reccnt | |
say 'Record count is ' strline.x | |
end | |
parse pull */ | |
CALL ShowDuplicates | |
ReadRecord: | |
"EXECIO 1 DISKR INLST " | |
if RC = 0 then do | |
parse pull RECORD | |
RecCnt = RecCnt +1 | |
strLine.RecCnt=RECORD | |
/* say strLine.RecCnt | |
parse pull */ | |
end | |
else do | |
Done=1 | |
end | |
return | |
CloseFile: | |
"EXECIO 1 DISKR INLST ( FINIS " | |
"FREE F(INLST)" | |
return | |
Initialize: | |
Done=0 | |
RecCnt=0 | |
if INDSN="" then do | |
say "ARG was not specified" | |
end | |
"ALLOC F(INLST) DA('"INDSN"') SHR " | |
return | |
ShowDuplicates: | |
say "Duplicate Summary For" RecCnt "records: " | |
say '' | |
do x = 1 to RecCnt by 1 | |
do y=x+1 to RecCnt by 1 | |
if substr(strLine.y,1,4) = "Prod" then do | |
if substr(strLine.x,1,4) = "Prod" then do | |
/* below is the product ID checking */ | |
if substr(strline.x,6,2) = substr(strline.y,6,2)then do | |
/* below is the cpu checking */ | |
if substr(strline.x,38,6)= substr(strline.y,38,6) then do | |
say 'Same PROD & Serial at lines' x 'and' y | |
say substr(strLine.x,1,70) | |
say substr(strLine.y,1,70) | |
say '' | |
end | |
end | |
end | |
end | |
end | |
end | |
parse pull | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment