Hello, I am trying to run a macro for min max dates for a few tables but because the dates are in different formats for each table (date9. and datetime9.) my final output is a correct or a number. Is there a way I can fix this so that each variable is correctly formatted in the table? (see code below). %macro date(variable,dataset,order); proc sql; create table all_dates_&order as select min(&variable) as min format=date9., max(&variable) as max format=date9., "&dataset" AS Table, "&variable" AS VARIABLE , &ORDER AS ORDER, "All HCS" AS NAME from &dataset a quit; %mend date; %hc_date(date_birth,demo_table, 1) %hc_date(effective_datetime, event_table, 2)
... View more