%macro dp3_2k(setin=_last_,title=); %let revdate=01Oct02; options nonumber nofmterr nodate nocenter skip=0; options linesize=120 pagesize=120 nocenter nodate; options nonumber nofmterr nodate nocenter skip=0; %put dp3_2k macro Rev. &revdate begins execution ****; /*** HTML PAGE CREATION ***/ /*==========================================================================================*/ data test; set sf3x.variables; where (pctflag=0 or UnivVar='') and display ne 0; if UnivVar ne '' then Pctname = 'Pct'||Name ; label=translate(label,' ','"'); run; data _null_; set test END=lastobs; call symput('name'||left(put(_n_,4.)),trim(name)); call symput('pctname'||left(put(_n_,4.)),trim(pctname)); call symput('label'||left(put(_n_,4.)),label); call symput('Universe'||left(put(_n_,4.)),Universe); call symput('format'||left(put(_n_,4.)),trim(format)); call symput('table'||left(put(_n_,4.)),table); call symput('tableno'||left(put(_n_,4.)),trim(tableno)); call symput('reftables'||left(put(_n_,4.)),trim(reftables)); run; %global last; data _null_; *--define &last as # obs in &setin--; if 0 then set &setin nobs=nobs; if 0 then set test nobs=nvars; call symput('last',left(put(nobs,5.))); call symput('lastobs',left(put(nvars,5.))); run; %macro makedata; %let pctfor = %str(5.1); data _null_; set &setin ; call symput('geo_'||left(put(_n_,4.)),put(geocode,$44.)); call symput('area_'||left(put(_n_,4.)),put(areaname,$90.)); call symput('logrec_'||left(put(_n_,4.)),put(LogRecNo,7.)); %do i = 1 %to &lastobs; call symput("value&i._"||left(put(_n_,4.)),put(&&name&i,&&format&i)); %if &&pctname&i ne %then %do; call symput("pctval&i._"||left(put(_n_,4.)),put(&&pctname&i,&pctfor)); %end; %end; run; data final; %do n = 1 %to &last; %do j=1 %to &lastobs ; length label $80 Universe $60 value $20 table $64 reftables $40 reflink $40 tabtitle $100 LogRecNo $20; label = " &&label&j "; value = " &&value&j._&n "; table = " &&table&j "; Universe = " &&universe&j "; reflink = " &&reftables&j "; tableno = " &&tableno&j "; Geocode = " &&geo_&n "; Areaname = " &&area_&n "; LogRecNo = " &&logrec_&n "; pctvalue = " &&pctval&j._&n "; reftables = translate(trim(left(reflink)),'_',' '); tabtitle=trim(table)||' - Universe: '|| Universe ; if index(pctvalue,'&') then pctvalue = ' '; output; %end; %end; run; %mend makedata; %makedata; %let state = %UPCASE(&st); options nobyline nodate missing=''; Title color='#9C0063' j=c 'MCDC Demographic Profile 3, 2000 Census'; %if %superq(title)=%str() %then %do; Title2 color='#9C0063' j=c "#byval2, &state &geocode "; %end; %else %do; title2 "&title"; %end; %global st co zi tr bg bl ms pm pl mc sd se sldl sldu ded dot rpc umx; %global query; data _null_; set final ; length url $1000; run; Footnote3 color='#9C0063' j=c h=0.9 f=helvetica 'Report by the' link="http://oseda.missouri.edu/" h=0.9 f=helvetica "Office of Social and Economic Data Analysis" color='#9C0063' ', Univ. of Missouri Outreach & Extension ' ; Footnote4 color='#9C0063' j=c h=0.9 f=helvetica 'Under a contract with the ' link="http://mcdc.missouri.edu/" h=0.9 f=helvetica "Missouri Census Data Center"; Footnote5 color='#9C0063' j=c h=0.9 f=helvetica 'SOURCE: U.S. Bureau of the Census, Summary File 3, 2000 Decennial Census'; Footnote6 color='#9C0063' j=c h=0.9 f=helvetica ' '; Footnote8 color='#9C0063' j=c h=0.9 f=helvetica 'Address questions and comments to' link="mailto:blodgettJ@umsystem.edu" h=0.9 f=arial "blodgettJ@umsystem.edu"; proc report data= final nowindows headskip headline spacing=1 ls=132 ps=40 split='/' CENTER style(header)=[foreground=WHITE font_face=helvetica font_size=2 ] style(column)=[foreground=black font_face=helvetica font_size=2] style(lines)=[foreground=black background=black font_face=helvetica font_weight=bold font_size=2]; by Geocode Areaname ; columns tableno table tabtitle logrecno Label value pctvalue geocode reftables ; define table / group noprint ; define TableNo / order order=data noprint; define Geocode / 'GEOCODE' group noprint; define Label / ' Subject ' display width=100 ; define Value / 'Number ' display RIGHT spacing=1 ; define pctvalue / ' Percent ' display RIGHT spacing=1 ; define reftables / 'SF3 Table' order order=data; define LogRecNo / noprint; define tabtitle / group noprint; compute before tabtitle / style=[foreground=black font_face=arial font_size=2 background=lightgrey just=left URL="http://mcdc2.missouri.edu/pub/data/sf32000x/Variables.pdf" HREFTARGET="Resource Window"] ; line tabtitle $100. ; endcomp; *compute reftables ; * if (&sumlev in ('610','620','sdu','sde')) | (%substr(&sumlev,1,2)=sd ) then urlstring = 'http://mcdc2.missouri.edu/sasweb/cgi-bin/broker?_PROGRAM=websas.sf3tabgen.sas&_service=sasapp&dataset='||"&set"||'&sumlev='||"&sumlev"||'&geocode='||"&geocode"||'&areaname=&tables='||trim(reftables); * else urlstring = 'http://mcdc2.missouri.edu/sasweb/cgi-bin/broker?_PROGRAM=websas.sf3tabgen.sas&_service=sasapp&dataset='||"&set"||'&tables='||trim(reftables)||'&logrecno='||left(trim(LogRecNo)); * call define (_col_,'URL',urlstring); * endcomp; run; %mend dp3_2k;