Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of CASELESS function in pos search

Status
Not open for further replies.

thiagarr

Technical User
Oct 20, 2006
86
US
Hi,

I have the following in my Open Object REXX script in Windows and I would like to know how I can make the search case-insensitive?

if left(line.i, 9) = "<!DOCTYPE" then
if pos("<errorCode>", line.k) > 0 then say line.k

Here I want to make the search case insensitive of the strings doctype and errorcode in the source file.

How can I achieve this? Any help will be appreciated.

Thanks and regards,

TR
 
Code:
if Upper( left(line.i, 9) ) = "<!DOCTYPE" then...

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Frank,

Thank you for the response and the details.

The use of Upper gives error as follows:

47 *-* if upper(left(line.i, 9)) = "<!DOCTYPE"
Error 43 running C:\keyword-miss\error35log.cmd line 47: Routine not found
Error 43.1: Could not find routine "UPPER"

The string <errorcode> appears as '<Errorcode>' or '<errorCode>' or similar combination of upper and lower cases in the source data file. I want to use something like CASELESS here but I am not sure if UPPER and CASELESS work outside of PARSE argument.

Any help would be appreciated.

Thanks and regards,

TR
 
Try TRANSLATE:
Code:
if Translate( left(line.i, 9) ) = "<!DOCTYPE" then...
TRANSLATE without patterns operates to uppercase its object.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Frank,

Thank you. That worked good.

:)

Thanks and regards,

TR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top