BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Peter_Wine
Calcite | Level 5

Hi All, I want to make a job in SAS DI Studio. Very simple transformation. I've got SAS table and want to use "Extract" transformation to extract data from it. In tab "Where" in Extract transformation I want to filter records by column "My_Date" which is in format yymmdd10. Conditions: -> My_Date = 2017-11-08 -> My_Date = '2017-11-08'd. -> My_Date = "2017-11-08"d. don't work. What is the proper condition?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Date literals are in the Date9 Format:

 

 

My_Date = '08Nov2017'd;

View solution in original post

5 REPLIES 5
Reeza
Super User

Date literals are in the Date9 Format:

 

 

My_Date = '08Nov2017'd;
Peter_Wine
Calcite | Level 5
Hi Reeza, Thanks, it works! 🙂
jklaverstijn
Rhodochrosite | Level 12

To expand on @Reeza's correct response: date, time and datetime values are never stored "in a format". They are always a number counting days or seconds from 01JAN1970. The format is merely an indicator that tells SAS how to present the value and this can be changed at will. So the format does not dictate how to formulate a constant in the WHERE clause. It is always as @Reeza explained.

 

Regards,

- Jan.

LinusH
Tourmaline | Level 20

Being bit picky, but it's from 01Jan1960....Man Tongue

Data never sleeps
jklaverstijn
Rhodochrosite | Level 12
You're not picky at all @LinusH. These details make all the difference. I stand corrected. 33 year of SAS just doesn't outweigh 40 years of Unix :-).

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1898 views
  • 0 likes
  • 4 in conversation