Eligible Names in a roster with sorting

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
joshua.deguito
Posts: 20
Joined: August 17th, 2022, 11:07 pm

Eligible Names in a roster with sorting

Post 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
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Eligible Names in a roster with sorting

Post 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
joshua.deguito
Posts: 20
Joined: August 17th, 2022, 11:07 pm

Re: Eligible Names in a roster with sorting

Post by joshua.deguito »

Thanks Sherrell, it works.
Post Reply