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

Hi guys... I have connectivity with Sql Srv database using Odbc connectivity. To load and unload data automatically on daily basis i m traying to write below code

/* Unload data from source table */
PROC CASUTIL;
ALTERTABLE CASDATA="Feedback_data" INCASLIB="test123" CASOUT="feedback_data" INCASLIB="test123";
QUIT;

/* Load data into destination table from SAS data set */
PROC CASUTIL;
LOAD CASDATA="SAS-data-set" INCASLIB="test123" CASOUT="feedback_data" OUTCASLIB="test123";
QUIT;


but I am Getting below error..

ERROR: A connection to the Cloud Analytic Services session could not be made.
ERROR: An error has occurred.
90 LOAD CASDATA="SAS-data-set" INCASLIB="test123" CASOUT="feedback_data" OUTCASLIB="test123";
ERROR: An error has occurred.

how to make connection to caslib ?
 






 

1 ACCEPTED SOLUTION

Accepted Solutions
SatishR
Obsidian | Level 7

@SASJedi Thanks for reply... I followed steps mentioned by you.

I am using SAS VIYA V.03.05.

Below code able to establish the cas session and load and unload the table from caslib created.

 

LIBNAME test123 ODBC  NOPROMPT="dsn=XXXXXXXXX;Trusted_Connection=yes"  SCHEMA=DBO ;
 
 
cas casauto sessopts=(caslib="test123"); 

/*To Unload the Data*/
 
PROC CASUTIL;
droptable CASDATA="Class_test" 
INCASLIB="test123";
QUIT;
 
/*To load the Data*/
proc casutil;
       load data=test123.Class_test promote;                                     /* 2 */  
   contents casdata="Class_test";
run;
 
 
 

View solution in original post

2 REPLIES 2
SASJedi
SAS Super FREQ

1. What version of SAS Viya are you using?

2. Please review the documentation for PROC CASUTIL:

  • The ALTERTABLE statement modifies an existing CAS table; it does not unload a table. To unload a CAS table from memory, use the DROPTABLE statement. 
  • To load a dataset from an existing SAS library to CAS, your LOAD statement should use Form 2 (LOAD DATA= )
    Note that this will perform a client-side load of the data, and may take a long time if the data is large.

3. Please share  your complete code, including:

  • the CAS statement (which initiated the CAS session)
  • the CASLIB statement (which established the caslib test123)

 

Check out my Jedi SAS Tricks for SAS Users
SatishR
Obsidian | Level 7

@SASJedi Thanks for reply... I followed steps mentioned by you.

I am using SAS VIYA V.03.05.

Below code able to establish the cas session and load and unload the table from caslib created.

 

LIBNAME test123 ODBC  NOPROMPT="dsn=XXXXXXXXX;Trusted_Connection=yes"  SCHEMA=DBO ;
 
 
cas casauto sessopts=(caslib="test123"); 

/*To Unload the Data*/
 
PROC CASUTIL;
droptable CASDATA="Class_test" 
INCASLIB="test123";
QUIT;
 
/*To load the Data*/
proc casutil;
       load data=test123.Class_test promote;                                     /* 2 */  
   contents casdata="Class_test";
run;
 
 
 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 793 views
  • 2 likes
  • 2 in conversation