I'm pulling data from many Teradata tables that have dates stored in MM/DD/YYYY
format (ex: 8/21/2003
, 10/7/2013
). SAS returns them as DDMMMYYYY
, or DATE9 format (ex: 21AUG2003
, 07OCT2013
). Is there a way to force SAS to return date variables as MM/DD/YYYY
, or MMDDYY10 format? I know I can manually specify this for specific columns, but I have a macro set up to execute the same query for 65 different tables:
%macro query(x);
proc sql;
connect using dbase;
create table &x. as select * from connection to dbase
(select *
from table.&x.);
disconnect from dbase;
quit;
%mend(query);
%query(bankaccount);
%query(budgetcat);
%query(timeattendance);
Some of these tables will have date variables and some won't. So I'd like the value to be returned as MMDDYY10
format by default. Thanks for your help!
format
inside theSELECT
clause? Not sure if ODBC allows it butproc sql
on SAS data does. This requires naming columns and not using asterisk:select mydate format=MMDDYY10., ... from ...
– Parfait