Use VarExamine to search for a specified character value within a specified variable.
VarExamine may also be entered as VarExam[ine] or VExam[ine].
Required Operands
OBJ is the name of a previously declared character variable.
STR If not enclosed in quotes, STR is the name of a previously declared character variable which contains the character value to search for. If enclosed in quotes, STR is the character value itself (up to 72 characters). If the value begins with the backslash character (, the search will use Extended Search Pattern rules.
Optional Operands
ZONE is the column range for the search. Enter it in the format "xxx-yyy" where xxx and yyy are numbers between 1 and 253 separated by a dash (-). For example, to limit the search to columns 10 to 20, specify ZONE as "10-20". If ZONE is not specified, the entire variable is searched.
CASE specifies whether upper/lower case should be considered when determining matches. If specified as "U", case is ignored ("the" matches "The"). If specified as "M", both case and letters must match. If CASE is not specified, "U" is assumed.
Return Codes
OK String found.
NF String not found.
Examples
Procedure to report all PF keys which reference a specified search value:
------------------------------------------------------------------------
SET PPDVBL,1
DCL PFNO,NUM,3,V
DCL STR,CHAR,80,V
DCL MSG,CHAR,80,V
PARSE STR
SET PFNO,0
LABEL PFLOOP
ADD PFNO,1
SET PPDCOND,1
VEXAMINE PF&PFNO,STR ; REPLACE PFNO TO GET NAME
IF SIBRETCD,EQ,OK
VAPPEND MSG,',PF&PFNO'
SET PPDCOND,0
IF PFNO,LT,24
GOTO -PFLOOP
IF MSG EQ ''
EXIT OK,'NO PF KEY REFERENCES "&STR"'
SETD MSG,MSG,2 ; GET RID OF INITIAL COMMA
EXIT OK,'&MSG REFERENCE(S) "&STR"'
------------------------------------------------------------------------