This example demonstrates that logical operations may be performed on string variables and/or string literals.
$$
$$ Declarations
$$
STRING/NAME1(30),NAME2(132)
FETCH/TXT,1,'NAMELIST',IFERR,A3:
A1:
TEXT/'ENTER FIRST NAME',NAME1,RSP
JUMP/A1:,A4:,A1:,,,RSP
LEN=LENF(NAME1)
EJECT
PRINT/'EMPLOYEES WITH THE FIRST NAME - '+NAME1
PRINT/''
RESET/1
DO/A2:,I,1,9999
READ/1,IFEND,A1:,NAME2
IF/NAME2==&NULSTR,JUMP/A2:
IF/SUBSTR(NAME2,1,LEN)==NAME1,PRINT/NAME2
A2:
A3:
MESSG/TEMP,'CANT GET FILE'
A4:
In the program above, the GPA &NULSTR was used to avoid an error with the SUBSTR function in the following statement.