Problem with create statement.


Fortran must die
SAS is connected to our primary data bases through a lib name I ran if that matters.

I run the following statement.

proc sql;
create table work.tab1
as select c.customerid format=$char9.,c.casenumber format=$char9.
,c.datebegin_14 format=date12., c.statuscase format=$char9., duration_14 format=best5.

from rimsrpt.rptcasesummary c
where c.extractdate = "31Dec2016"d
and c.datebegin_at_clo IS NULL
and datebegin_14 >= "01Jan2016"d;

The string and number variables show up fine. But for some reason the date variable shows all asterisks rather than the actual data that is in the source table. If it matters our tables use NULL rather than . for missing values in dates (which confuses SAS often as it thinks they are strings). But they are stored on the MS server as datetime.

I tried using a string format for this field (datebegin_14) rather than a datetime and got an error.