DATA Step, Macro, Functions and more

Date format is incorrect

Reply
New Contributor
Posts: 2

Date format is incorrect

We have been using Netezza as one of the source in SAS which will be assigned as libname, so that we can able to drive those tables as like other SAS libraries. Issue : Netezza have only DATE datatype and when I open the table in SAS it shows as numeric and format as Date9. But am expecting the date format as MMDDYY10. to be displayed in format. With Date9. format while appending the data to column have MMDDYY10. warning has been displayed. Is there any way to change all the date format to MMDDYY10. in Libname itself..
Super User
Posts: 7,868

Re: Date format is incorrect

[ Edited ]
Posted in reply to karthickbe

Just checked here: you get a WARNING entry in the log, but the SYSCC is not changed, so you won't have a problem in a batch job.

 

But have you considered using a data step with

data basedata;
set
  basedata
  appenddata
;
run;

?

In this case, you get no WARNING, and the format from basedata is kept.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 2

Re: Date format is incorrect

Posted in reply to KurtBremser

Thanks Kurt...

 

Netezza DATE datatype is displayed as DATE9. format in SAS...

My main concern is any option available to control implicit date format conversion to MMDDYY10. instead of DATE9. in Libname statement..

 

 

regards..Karthick

Super User
Posts: 7,868

Re: Date format is incorrect

Posted in reply to karthickbe

How about defining a view to the netezza table that sets the correct attribute, and then use that view as the data= in proc append?

 

Another option is to use the stringdates= option in the libname statement and treat all date values as character until you finally need them as numeric in SAS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 3 replies
  • 242 views
  • 0 likes
  • 2 in conversation