* used by the websas.classroom_obs program; %macro transp(survey_answers,work,destin,rectangular_sas_dataset,db,key_var=user_id,wherestr=); *first sort table containing values to be sure they are in proper order; *the first dot is to end the previous micro, the second dot is the real dot; * may need to change User_ID to Survey_ID for anonymous surveys; proc sort data=&db..&survey_answers &wherestr out=&work..viewuser_survey_sorted; by &key_var date_completed ip_completed distcode schoolid; *****************************************************************************; *transpose sorted values table; *new; *---district_id and building_id vars added to by list by jgb and wrl, 10/17/2007 11:21:43 AM; *change district_id and building_id to distcode and schoolid *; proc transpose data=&work..viewuser_survey_sorted out=&destin..&rectangular_sas_dataset (drop=_name_ _label_) ; var answer; by &key_var date_completed ip_completed distcode schoolid; id sas_varname; idlabel Question_Text; run; %mend transp;