Automatically make the system to preselect the 1st options that appear in setvalueset
Posted: July 26th, 2022, 6:44 am
Hi family,
I have a challenge here.
I created a setvalueset from the a roster using preproc. Is there a way to allow the system to select the 1st option that appear in the setvalueset RESULTS regardless about the value serial numbering?
for example
Below is the logic I used to pull out the list of eligible person's in the household age 15-49years at random
PROC ID_FROM_THE_ROSTER
preproc
do numeric i = 1 while i <= totocc(ROSTER000)
if AGE(i) in 15:149 then
RosterRespondent.add(NAME(i),i);
endif;
enddo;
seed(systime());
RosterRespondent.randomize();
setvalueset($,RosterRespondent);
the results I got is;
option1 3. Child1
option2 5. Child
option1 7. Child5
Can any one assist me with a logic to make the program automatically select the the 1st position(child3) from the setvalueset results above?
Thank you
I have a challenge here.
I created a setvalueset from the a roster using preproc. Is there a way to allow the system to select the 1st option that appear in the setvalueset RESULTS regardless about the value serial numbering?
for example
Below is the logic I used to pull out the list of eligible person's in the household age 15-49years at random
PROC ID_FROM_THE_ROSTER
preproc
do numeric i = 1 while i <= totocc(ROSTER000)
if AGE(i) in 15:149 then
RosterRespondent.add(NAME(i),i);
endif;
enddo;
seed(systime());
RosterRespondent.randomize();
setvalueset($,RosterRespondent);
the results I got is;
option1 3. Child1
option2 5. Child
option1 7. Child5
Can any one assist me with a logic to make the program automatically select the the 1st position(child3) from the setvalueset results above?
Thank you