x cd /pub/data/irsmig/Tools; %let pgm=genmenus_irsmig; filename pgm "&pgm..sas"; *---Generate static menu pages using genslct macro with the GO option. *<===== ***Be sure to update /pub/websas/templates/irsmig.html before running this setup each year *** !!!!!========= jgb, 4-24-07 and again 8-07 to generate new pages with 0506 year option added and selected. And again, 8-19-08 to add 0607 year. And again, 10-20-09 to add 0708 year. Modified to work for generating a special menu page with state-to-state profiles where user gets to select the state. 10-21-09. Uses the new templt2 file. 12-30-09: After modifying the irsmig.html template file to include a link to the state level menu page, we rerun this pgm to modify the menus 07-25-11: rerunning for the 0809 year addition. 12-05-11: rerunning for the 0910 year addition. ---*; filename template "/pub/websas/templates/irsmig.html"; filename templt2 "/pub/websas/templates/irsmig_states.html"; filename htmlout "/pub/data/irsmig/Migration_Profiles/XX.html"; libname popests '/pub/data/popests' access=readonly; data menudata menudata2; **(index=(state)); set popests.uscom09; where state ne '72'; if sumlev='050' then output menudata; else if sumlev='040' then output menudata2; keep state cnty areaname; run; %macro doit(state,stab); %let st=&state; data _null_; if _n_=1 then do; *---read and write the page image up to the ##select line---; %if &state=00 %then %str(infile templt2;); %else %str( infile template;); length fv $64; length _ln $200; retain fv "/pub/data/irsmig/Migration_Profiles/XX.html"; ***retain fv "/pub/data/irsmig/testmenus/XX.html"; _ix=index(fv,'XX'); substr(fv,_ix)= %if &state=00 %then %do; 'US State-to-State.html' %end; %else %do; translate("&statenm.",'_',' ')||'.html'; %end; ; file htmlout filevar=fv; do _nline=1 to 1000 ; link input; if _infile_='##select' then leave; _ln=resolve(_infile_); put _ln; end; end; _menuurl='https://mcdc.missouri.edu/cgi-bin/broker?_PROGRAM=websas.irsmig_menu.sas&st=29'; _ln="(in the state of &statenm.. To select a different state go to Main Menu)
"; put _ln; *---generate the select statement---; %if &state=00 %then %do; _ln="