BookmarkSubscribeRSS Feed
pangea17
Quartz | Level 8

I am having a problem with date conversion.  Sor some reason when I pull information from my datawarehouse using the datapart function in SQL the number ends up with a character format.  When I use the same procedure on a different table that has the date formatted the same way, the variable comes down as a numeric.  I checked the tables to make sure they are formatted the same way, and they are exactly the same.  In the meantime I just pulled the data using SQL in step one, and formatted the data in a "data step" in step two and that works.  But I am wordering if this is a common problem.  I had been running this job for over 2 years and had no problems.  I have enclosed an attachment that details my results.  SAS enterprise guide 6.1 64-bit

6 REPLIES 6
Reeza
Super User

This is a question for tech support.

data_null__
Jade | Level 19

@pangea17 I see you "liked" my post.  Does that mean it help you solve the problem and if so could you show the code you changed or whatever you did.  It would help to know if/how you fixed it.  It may be useful to others.

pangea17
Quartz | Level 8

It didn't work as of yet, but my IT department is looking into the problem.

data_null__
Jade | Level 19

Did you try the option?

 

A problem will result if later code treats that variable as a DATE rather than as a DATETIME. 
The only workaround is to turn off implicit pass-through so that the function is not passed
to the DBMS and is instead processed by SAS. This can be done by setting the DIRECT_EXE= LIBNAME option.
SASKiwi
PROC Star

What database and which SAS/ACCESS product are you using? 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1101 views
  • 2 likes
  • 4 in conversation