sadeq wrote
Thanks gents, very helpful.
Two different solutions.
DATA LIST / did (A4).
BEGIN DATA
abc
abc
abd
abz
abz
abdz
agdz
END DATA.
COMPUTE a_z= CHAR.INDEX(did,'a') EQ 1 AND CHAR.RINDEX(did,'z')EQ CHAR.LENGTH(did).
COMPUTE a_z2=CHAR.SUBSTR(did,1,1) EQ 'a' AND CHAR.SUBSTR(did,CHAR.LENGTH(did),1) EQ 'z'.
LIST.
did a_z a_z2
abc .00 .00
abc .00 .00
abd .00 .00
abz 1.00 1.00
abz 1.00 1.00
abdz 1.00 1.00
agdz 1.00 1.00
Number of cases read: 7 Number of cases listed: 7
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"