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

Good morning,

Im looking to see if sas can accomodate something similar to ISdate() function similar to sql,

 

i tried it in sas but its returning the function is not available.

 

my goal is to filter through 6million records to count any instance of non date and time in a field.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Unlike DataBase ,SAS don't have DATE type variable .

As long as integer take on date format , this variable is becoming a 'DATE' variable.

You can use function FMTINFO() to check if its format is a date or not .

Learn it from  @Tom yesterday .

View solution in original post

3 REPLIES 3
Oligolas
Barite | Level 11

Not directly ASFAIK but...

in PROC SQL you can use SAS functions and among them, regular expression functions.

You could therefore check if a given field conforms to your date/datetime requirements before retrieving the records.

You could also preprocess your dataset in order to determine the fields you are interested in.

These are 2 possibilities among others.

________________________

- Cheers -

RW9
Diamond | Level 26 RW9
Diamond | Level 26
count(case when input(date,date9.) > . then 1 else 0 end) as NUM_DATES

The input function will return a date or . depending on the data, so you can do the above.

 

 

Ksharp
Super User

Unlike DataBase ,SAS don't have DATE type variable .

As long as integer take on date format , this variable is becoming a 'DATE' variable.

You can use function FMTINFO() to check if its format is a date or not .

Learn it from  @Tom yesterday .

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
  • 3 replies
  • 9619 views
  • 3 likes
  • 4 in conversation