/* assuming T, X, Z, Y and R are variables containing warehouse names */
if WordPos(Wh_ipt,T X Z Y R) <> 0
/* assuming T, X, Z, Y and R are warehouse names */
if WordPos(Wh_ipt,'T X Z Y R') <> 0
A note about your PULL: if you are reading your input from a file (in batch, for example),
variable Wh_ipt will have a lot of extra spaces on the right (up to the record length, almost certainly 80).
You can prevent that by doing:
/* assuming you expect only ONE WORD */
Parse PULL Wh_ipt .
/* assuming you expect MORE THAN ONE WORD */
Parse PULL Wh_ipt
Wh_ipt = Strip(Wh_ipt)
For example, extra spaces in the DSNAME parameter is a cause of failure in ALLOC statements, .