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’.
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:
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.
To complete this, the ‘load data’ option is used. This specifies the libname and data set which will be loaded into a caslib.
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:
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.
If you are a SAS user looking to understand and learn new programming techniques and sintax within the SAS Viya environment our SAS training courses might be right for you.