Meta Search
search across all the following databases:
Data Catalog
Data and documentation
KnowledgeBase
Common questions and answers.
Resources
Entire collection of data resources.
Lessons from North of the Border
Nerd Alert: Dictionary of Numbers
This is an example of a program that selects a person into the sample if anyone in the household is foreign born.
This example requires that there is a variable that provides a count of the number of persons in the household.
See the following for an example of a program that doesn't require this assumption.
*******************************************************************;
filename pums90 pipe 'zcat
/usr/data/public/us/government/pums/1990/5pct/tx48.Z
';
filename out1 'exer4.dat';
/* INPUT data */
data a;
retain state persons fborn;
infile pums90;
array age(29) age1-age29;
array sex(29) sex1-sex29;
array rpob(29) rpob1-rpob29;
array pwgt(29) pwgt1-pwgt29;
input @1 type $1. @;
if type='H' then do;
input state $11-12 persons 33-34;
fborn=0;
return;
end;
else do i=1 to persons;
input relat(i) 9-10 sex(i) 11 age(i) 15-16 pwgt(i) 18-21 rpob(i) 29-30
;
if rpob(i)>=51 then fborn=fborn+1;
end;
if fborn>=1 then do i=1 to persons;
file out1;
put state $1-2 age(i) 4-5 sex(i) 7 rpob(i) 9-10 pwgt(i) 12-15;
output;
end;
run;