Check confirms that every character in the factor two string is in the list in factor 1
Example 'ABCDEF' Check TestString
If testString contained 'BBB' or 'BAC' it would pass-- every character are in the factor 1 val.
If testString contained 'A123' or 'Fabcdef' it would fail and return the position 2 - where the first unacceptable character was found.
Scan looks for an exact match'
Example 'ABCDEF' Scan TestString
If testString contained 'BBB' or 'BAC' it would fail
If testString contained '123' or 'abcdef' it would fail.
If testString contained '123ABCDEF456' it would pass and return the position 4 (where it's found)
Last Wiki Answer Submitted: October 6, 2008 1:31 pm by philpl1jb44,630 pts.
All Answer Wiki Contributors: philpl1jb44,630 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Hi Philip or anybody
thanks for your answer. But still i am confused by the example you have given and Factor1 and Factor2 and result. Can you please elaborate and excplain it clearly with a better example…
Here the string UPCSTR is tested for any value other than the 10 digits
If UPCSTR = ’92AB569ZZ999′
then BadPos would contain the value 3 – the first position containing the character ‘A’
because that character wasn’t in the ValidSTR ‘
Newer function that does the same thing
BadPos = %CHECK( ValidSTR : UPCSTR)
———————————————————————-
Scan would be used in a text search situation like partial name
SearchStr = ‘BOB’
SearchStr SCAN FullNameStr
If %found
Exsr AddRecSFL
Endif
Found values would be ‘BOB BLAKE’, ‘JIM ROBOBD’, ‘SUE BOBBY BOOP’
Not Found values would be ‘Bob Blake’, ‘PHIL GORILLA’, ‘MAX SMITH’
Hi Philip or anybody
thanks for your answer. But still i am confused by the example you have given and Factor1 and Factor2 and result. Can you please elaborate and excplain it clearly with a better example…
regards
Ram
Check might be used to test a text string to determine if it’s a valid UPC number – (only digits)
ValidSTR = ’1234567890′
ValidSTR Check UPCSTR BadPos
if BadPos > 0
Exsr BadUPCSTR
Endif
Here the string UPCSTR is tested for any value other than the 10 digits
If UPCSTR = ’92AB569ZZ999′
then BadPos would contain the value 3 – the first position containing the character ‘A’
because that character wasn’t in the ValidSTR ‘
Newer function that does the same thing
BadPos = %CHECK( ValidSTR : UPCSTR)
———————————————————————-
Scan would be used in a text search situation like partial name
SearchStr = ‘BOB’
SearchStr SCAN FullNameStr
If %found
Exsr AddRecSFL
Endif
Found values would be ‘BOB BLAKE’, ‘JIM ROBOBD’, ‘SUE BOBBY BOOP’
Not Found values would be ‘Bob Blake’, ‘PHIL GORILLA’, ‘MAX SMITH’
Alternative format
PosFnd = %SCAN( SearchStr : FullNameStr)
If PosFnd > 0
…
or
If %SCAN( SearchStr : FullNameStr) > 0