BookmarkSubscribeRSS Feed

SAS Viya 2021.1.2: New GCS (Google Cloud Storage) CASLIB

Started ‎07-15-2021 by
Modified ‎07-15-2021 by
Views 4,111

SAS has supported cloud object storage for years now, starting with AWS S3 and then Azure ADLS. Google Cloud Storage or GCS was the only missing one in the SAS picture among the “big three” cloud providers. Now it’s done! A new GCS CASLIB has been introduced in the recent 2021.1.2 stable release.

 

Let’s have a look at it!

 

 

How to setup the GCS CASLIB?

 

Simple. You just have to define:

  • The GCS bucket that you want to access
  • The GCS credentials file
  • The path inside the bucket that you want to assign

  Here is an example:

 

caslib gcs datasource=(srctype="gcs" bucket="gcs_dm"
   gcsauthfile="/gcpdm/sa/gel_gcpdm_sa_key.json")
   path="data" subdirs libref=gcs ;

 

Here, my “gcs_dm” bucket contains a “data” root folder. The credentials file contains the GCP project to connect to. Now you can start using the GCS CASLIB as you would use any CASLIB.

 

 

Supported File Types

 

In this first iteration, only single CSV files are supported. You can load a CSV file from GCS to CAS and you can save a CAS table to GCS as a CSV file.

 

proc casutil incaslib="gcs" outcaslib="gcs" ;
   load casdata="contact_list.csv" casout="contact_list" ;
quit ;

proc casutil incaslib="gcs" outcaslib="gcs" ;
   save casdata="prdsale" casout="prdsale.csv" ;
quit ;

 

Loading is done in parallel in case of an MPP CAS. Saving to CSV is always serial. More information in the documentation.  

 

 

In the User Interface

 

To define a GCS CASLIB in the user interface ("Manage Data" or SAS Environment Manager "Data"), you need to define the type to Other and define the GCS CASLIB options as "Additional Parameters" as shown below:

 

nir_post_65_01_gcs_caslib.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

 

nir_post_65_02_caslib_parameters.png

 

 

Conclusion

 

SAS Viya has now a pretty good coverage of the main cloud object storage providers. After AWS S3 and Microsoft Azure ADLS, Google Cloud Storage has been added.

 

CI/CD allows R&D to deliver new features every month, even if they don’t provide full capabilities yet. The GCS CASLIB will be enriched in the next few months.

 

Thanks for reading.

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎07-15-2021 11:41 AM
Updated by:
Contributors

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!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started