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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1879 views
  • 0 likes
  • 4 in conversation