Page 1 of 1

Eligible Names in a roster with sorting

Posted: January 23rd, 2023, 4:47 am
by joshua.deguito
Hi everyone,

Can someone help me on how to do this in a Census roster?

CENSUS has variables NAME, AGE, SEX:
NAME AGE SEX
Occ1. mike 33 male
Occ2. gen 22 female
Occ3. dan 45 male
Occ4. jody 55 female
Occ5....

After entering Household members in CENSUS, I want to save the list of Female household members from oldest to youngest.
Currently I have this code,

preproc
list string eligible;

for numeric line_number in CENSUS000 where AGE > 17 and SEX = female do
eligible.add(NAME);
endfor;

How can I sort the list string eligible Names by Oldest to youngest?

Thank you,
Josh

Re: Eligible Names in a roster with sorting

Posted: January 23rd, 2023, 10:26 am
by sherrell
Hi Josh,

If you build a valueset instead of a list, you can sort the VS.

https://www.csprousers.org/help/CSPro/v ... ction.html

Sherrell

Re: Eligible Names in a roster with sorting

Posted: January 30th, 2023, 8:34 pm
by joshua.deguito
Thanks Sherrell, it works.