I am a very experienced programmer, but a novice in SAS. I would like to convert ALL date9 fields to yymmdd10. I am unloading an entire DB2 table with Proc SQL Select *. I do not know what the fields are, nor do I want to. In the case of the first DB2 table, there were 59 date fields. My program is intended to be very generic, in so that the Table is passed in as an input parameter. Thus not wanting to code any field names. I would like all dates to be in the same format as on the database (yyyy-mm-dd). Please advise on how this could be done. Thanks Here is my sample code: %MACRO EXTRACT(SSID=,CREATOR=,TAB=,DELIM=);
* EXTRACT DATA FROM ANY TABLE BASED ON TAB_KEY
OPTIONS
MISSING=0
MPRINT
ERRORS=0
NOOVP
;
PROC SQL;
%include "/sas/connect/&SSID.connect.sas";
CREATE TABLE TABLE1 AS
SELECT *
FROM CONNECTION TO DB2(
SELECT *
FROM &CREATOR..&TAB
WHERE TAB_KEY IN (
'12340AABB',
'23450CCDD',
'34560DDEE',
'45670RRFF',
'xxxxxxxxx')
);
DISCONNECT FROM DB2;
%PUT &SQLXMSG;
proc export
data=table1
outfile=ddout
dbms=dlm ;
delimiter=&DELIM;
RUN;
%MEND EXTRACT;
%EXTRACT(CREATOR=AAA,DELIM=',',TAB=AA11,SSID=sys1)
... View more