/* script generated by RDBMS2SAS.py on Wed Jan 26 15:13:32 2011 */ options compress=binary; options set=SASMYL MYWIN417; libname metadata mysql user='oseda_reader' password='dataareevil' database='metadata' server='oseda-public.missouri.edu' port=3306; libname cwd '/web/mcdc/scripts2/acs/2009/acsprofiles/sas_datasets'; proc sql; create table cwd.Variables as select distinct a.variable_name, a.variable_descr, b.definition, b.comments, (case when a.variable_format='%d' then 'comma9.' when a.variable_format='$ %d' then 'dollar9.' when a.variable_format='%4.1f' then '4.1' when a.variable_format='%5.1f' then '5.1' when a.variable_format='%5.2f' then '5.2' else a.variable_format end) as variable_format, d.universe_descr, u.variable_name as UnivVar, w.variable_name as WtVar, a1.variable_name as percent_variable, b1.definition as percent_definition, a2.variable_name as moe_variable, b2.definition as moe_definition, a.indent_level, d.subject_title, d.subject_id, '' as keywords, '2009' as year, '2008 ACS Profiles, US Census Burea', a.reference_tables as reftables, d.subject_group, a.variable_id from metadata.profile_variables_extra b, metadata.profile_tbl c, metadata.profile_subjects d, metadata.profile_variables a left outer join metadata.profile_variables a1 on (a.profile_id=a1.profile_id and a.percent_id=a1.variable_id) left outer join metadata.profile_variables_extra b1 on (a1.profile_id=b1.profile_id and a1.variable_id=b1.variable_id) left outer join metadata.profile_variables a2 on (a.profile_id=a2.profile_id and a.moe_id=a2.variable_id) left outer join metadata.profile_variables_extra b2 on (a2.profile_id=b2.profile_id and a2.variable_id=b2.variable_id) left outer join metadata.profile_variables u on (a.profile_id=u.profile_id and a.universe_id=u.variable_id) left outer join metadata.profile_variables w on (a.profile_id=w.profile_id and a.weight_id=w.variable_id) where a.profile_id=c.profile_id and c.schemata='acs' and c.table_name='usmcdcprofiles_2009' and a.profile_id=b.profile_id and a.variable_id=b.variable_id and a.variable_name not like ('%_moe') and a.profile_id=d.profile_id and a.subject_id=d.subject_id order by a.variable_order; quit; data cwd.Variables(label='Variables in ACS 2009 Profiles'); set cwd.Variables; informat _numeric_; informat _character_; ; run;