Dear team;
I faced to write a skip logic in my application. My problem is:
for example: Q1 is string variable with multiple responses ABCDE, Q2 is string variable with multiple responses ABCDE and Q3 is string variable with multiple responses ABCDE. Now I have Q4 variable with single response and numeric variable. Now I want to ask the Q4 variable if Q1 = ABC or Q2 = ABC or Q3 = ABC otherwise I want to skip to Q8. Seeking for your advice.
Thank you.
Best
Brti
Check string var
-
sherrell
- Posts: 407
- Joined: April 2nd, 2014, 9:16 pm
- Location: Washington, DC
Re: Check string var
>Now I want to ask the Q4 variable if Q1 = ABC or Q2 = ABC or Q3 = ABC otherwise I want to skip to Q8.
if you didn't have the skip, I would have written:
but since you have the skip, I'd make it:
Be sure to set the field properties for Q1-Q3 to uppercase, for otherwise you'll have people entering lowercase letters and your logic will fail (or allow lowercase letters as well, but I find that sloppy/inconsistent).
Sherrell
if you didn't have the skip, I would have written:
Code: Select all
PROC Q4
preproc
ask if Q1 in 'A','B','C' or Q2 in 'A','B','C' or Q3 in 'A','B','C';Code: Select all
PROC Q4
preproc
if Q1 in 'A','B','C' or Q2 in 'A','B','C' or Q3 in 'A','B','C' then
// nop, stay put
else
skip to Q8;
endif;
Sherrell