BookmarkSubscribeRSS Feed
Fluorite | Level 6

I am loading data in a CASLIB so that I can import it into my program and analyse it, with the following code:


proc casutil session=MY_SESS incaslib="&caslib." outcaslib="&caslib.";
   load casdata="&sourceTable." casout="&sourceTable." replace;

I then get the following warning message:

WARNING: Invalid date value '209-6-16'

This is obviously because the date value should probably be '2019-6-16' and hence is not a valid date.


Now I can see in Viya 4 there is the option of how to handle invalid dates here, how would I implement that into my code? I have tried every use of dataSourceOptions I can think of and can't make it work!

I am in Viya 3.5, is the warning suppression not available until Viya 4?

It's not the end of the world, but in our processes we try and minimise warnings so would be nice if anyone has any ideas about how to suppress this warning.

Note - Fixing the date at source isn't an option, we would like to that in SAS!


Super User

Since the procedure may use different options for each data source you might at least mention what you are connecting to so have some chance of helping.

That link to the help you provided only works with

  DB2, Microsoft SQL Server, ODBC, PostgreSQL

If you are using a different source it isn't going to be available.

Opal | Level 21

As you've suggested that option isn't available in Viya 3.5. You could always read the data into a SAS dataset first, set invalid dates to missing, then load to CAS using the dataset. It just depends if you are OK with having that extra step.

Fluorite | Level 6

Hi both,

Thanks for your help.
It's an Oracle connection, so should work, but I think as said there just isn't any way of using in 3.5 sadly.

I will explore the suggested option of loading it into a SAS dataset first, thanks both.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Discussion stats
  • 3 replies
  • 3 in conversation