Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
When I need 3 or more ORs, I prefer to use:
Code: |
/* assuming T, X, Z, Y and R are variables containing warehouse names */
if WordPos(Wh_ipt,T X Z Y R) <> 0 |
or
Code: |
/* 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:
Code: |
/* assuming you expect only ONE WORD */
Parse PULL Wh_ipt . |
or
Code: |
/* 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, . |
|