x cd /pub/data/popests/Tools; %let pgm=states_as2004; filename pgm "&pgm..sas"; *--Convert state level age (not detailed) and sex estimates for 7-1-2004. John Blodgett, OSEDA, U of Mo Outreach & Extension Under contract with the Missouri Census Data Center 3/04 --*; %let temp=; ***temp; *<====change to null value when data is no longer embargoed and is moved to popests directory--; libname popests "/pub/data/popests/&temp"; filename in "/pub/data/popests/rawdata/ST-EST2004-AS2004.csv"; *<===we downloaded the corresponding "base" pops for 4-1-2000 which are stored in a file with a similar name but ending with AS200004.csv (??). But for now we will not waste space and time converting those since they are readily available elsewhere.; data popests.us&pgm(label="US State pop ests by broad age categories by Age and Sex, 7-1-2004"); infile in dsd firstobs=2 lrecl=512; ; length SumLev $3 State $2 Reg $1 Div $1 AreaName $32 POPESTIMATE2004 POPEST2004_MALE POPEST2004_FEM UNDER5_2004_TOT UNDER5_2004_MALE UNDER5_2004_FEM AGE513_2004_TOT AGE513_2004_MALE AGE513_2004_FEM AGE1417_2004_TOT AGE1417_2004_MALE AGE1417_2004_FEM AGE1824_2004_TOT AGE1824_2004_MALE AGE1824_2004_FEM AGE16PLUS_2004_TOT AGE16PLUS_2004_MALE AGE16PLUS_2004_FEM AGE18PLUS_2004_TOT AGE18PLUS_2004_MALE AGE18PLUS_2004_FEM AGE1544_2004_TOT AGE1544_2004_MALE AGE1544_2004_FEM AGE65PLUS_2004_TOT AGE65PLUS_2004_MALE AGE65PLUS_2004_FEM AGE85PLUS_2004_TOT AGE85PLUS_2004_MALE 8; input state reg div Areaname popestimate2004--age85plus_2004_male; if _n_=1 then SumLev='010'; else sumlev='040'; format popestimate2004--age85plus_2004_male comma12.; run; proc means data=_last_ sum maxdec=0; class sumlev; var popestimate2004; run;