Page 1 of 1

Skip connection in 2 roster

Posted: October 17th, 2017, 4:59 am
by Socio
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

Re: Skip connection in 2 roster

Posted: October 17th, 2017, 7:17 am
by josh
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;

Re: Skip connection in 2 roster

Posted: October 18th, 2017, 3:28 am
by Socio
Dear Josh

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;
Unfortunately its not working. Please help me.

Re: Skip connection in 2 roster

Posted: October 18th, 2017, 7:48 am
by josh
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;

Re: Skip connection in 2 roster

Posted: October 20th, 2017, 3:42 am
by Socio
Thank you, Josh
The given code is working.
PROC Q3
preproc
if Q2(curocc()) = 2 then
    
skip to next;
endif;