I have 2 roster
Roster 1 (with 9 occurrence)
Q1 Q2
Roster 2 (with 9 occurrence)
Q3 Q4 Q5
I want to skip complete row (same row with Q2) in roster 2 if Q2 = 2
Thank you.
I have attached a file of the form
Skip connection in 2 roster
Skip connection in 2 roster
- Attachments
-
- Roster 1 and 2.docx
- (12.27 KiB) Downloaded 341 times
Re: Skip connection in 2 roster
You can use to "skip to next" to skip an entire row in a roster. So to skip the entire row if Q2 = 2 you would do something like:
PROC Q3
preproc
if Q2 = 2 then
skip to next;
endif;
preproc
if Q2 = 2 then
skip to next;
endif;
Re: Skip connection in 2 roster
Dear Josh
Thank you for this. When I write the code it shows error message to add subscript, so I add like this
Unfortunately its not working. Please help me.
Thank you for this. When I write the code it shows error message to add subscript, so I add like this
Code: Select all
PROC Q3
preproc
if Q2 (1/9) = 2 then
skip to next;
endif;
Re: Skip connection in 2 roster
Sorry, yes you need a subscript here. Since you are in the second roster, CSPro doesn't know which row number to use when referring to a variable in the first roster. See here for more info subscripts (http://www.csprousers.org/help/CSPro/subscripts.html). In this case you can use curocc() (http://www.csprousers.org/help/CSPro/cu ... ction.html) for the subscript. That will use the row number from the second roster as the subscript for the first roster i.e. you will use the variable in the corresponding row.
PROC Q3
preproc
if Q2(curocc()) = 2 then
skip to next;
endif;
preproc
if Q2(curocc()) = 2 then
skip to next;
endif;
Re: Skip connection in 2 roster
Thank you, Josh
The given code is working.
The given code is working.
PROC Q3
preproc
if Q2(curocc()) = 2 then
skip to next;
endif;
preproc
if Q2(curocc()) = 2 then
skip to next;
endif;