BookmarkSubscribeRSS Feed
user24feb
Barite | Level 11

Hello,

I am trying to access data through SAS Access to ODBC using the little test program below:


Libname sqlserv ODBC Schema=DBO DSN=sassql;
Libname Daten "C:\Users\MyName\Desktop\xxx\Daten";

Proc SQL NoPrint;
  Create Table Daten.Query_1_Test As
  Select Sum(Quantity_OpenOrder_t_IsBillingNo) As Qty_OpenOrder_t Format=Commax15.3,
         KeyDate_Month_Key  
  From sqlserv.vFact_SalesOrder_DP 
  Where KeyDate_Month_Key in (201401)
  Group By KeyDate_Month_Key
  Order By KeyDate_Month_Key   
  ;
Quit;

The problem is that it yields different results when I run it at different times. The code runs without errors. The data is historical data. Is there a way to check if the SQL-procedure timed out or caused a different error that does not show in the log during execution?

1 REPLY 1
stat_sas
Ammonite | Level 13

Hi,

Not sure, seems like KeyDate_Month_Key picking something else in addition to 201401. Modify where clause and try this to see how it works.

Where KeyDate_Month_Key in (201401) and KeyDate_Month_Key is not null

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
  • 1 reply
  • 261 views
  • 3 likes
  • 2 in conversation