BookmarkSubscribeRSS Feed
shiney_martin1
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;
quit;

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!

 

3 REPLIES 3
ballardw
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.

SASKiwi
PROC Star

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.

shiney_martin1
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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 3 replies
  • 656 views
  • 0 likes
  • 3 in conversation