Eligible Names in a roster with sorting
Posted: January 23rd, 2023, 4:47 am
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
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