Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

SAS® Viya™: Load SAS Data from a Libname to a Caslib

Once you have connected to a CAS session you are able to load data into cas. To perform this task, a snippet is available within SAS Studio named ‘Load data to caslib’.

SAS Viya Load SAS Data from a Libname to a Caslib Image 1

The snippet contains three sections dependent on the data you would like to load into a caslib. When the data is loaded into a caslib, three options are required on the statement:

  1. Outcaslib - the caslib to load the data into.
  2. Casout - the table name you would like to call the in-memory table within CAS.
  3. Promote - specifies that the data loaded will be available to all active CAS sessions (optional).

In addition to these three options, each section has additional options which are required to load types of data.

Load SAS Data from a Base Engine Library

The second section allows users to load data from a SAS data set. This can be used to load data from a pre-defined library within SAS into a caslib.

SAS Viya Load SAS Data from a Libname to a Caslib Image 2
To complete this, the 'load data' option is used. This specifies the libname and data set which will be loaded into a caslib.

Load a SAS HELP Data Set into CAS

To demonstrate loading a SAS data set into CAS, we will look at the baseball data set within the SAS HELP library. To load the data, we would modify the default code to the following:

SAS Viya Load SAS Data from a Libname to a Caslib Image 5
This code loads the baseball data set within the SAS HELP library into the CAS library casuser, with the name BaseballTable. This can be seen within the logs for the run.

SAS Viya Load SAS Data from a Libname to a Caslib Image 4