SASEFRED Interface Engine

Example 48.5 Using the GOCAS= Option

To use the GOCAS= option, add the following options to your SASEFRED LIBNAME statement:

GOCAS=ON

specifies that the CAS server is being used.

CASLIB=<name of CAS libref>

names the CAS library reference for storing the in-memory tables created by the SASEFRED engine.

CASOUT=<name of CAS table>

names the in-memory table where the FRED data are stored.

The following code shows how to use CAS with Example 48.4:

   options validvarname=any;
   title 'Using GOCAS= Option to Store Series in CAS Table';

   libname fred sasefred "<directory>"
      GOCAS=ON
      CASLIB=<caslib name>
      CASOUT=M2MYFRED
      OUTXML=fredex04
      AUTOMAP=replace
      MAPREF=MyMap
      XMLMAP="<directory>fredex04.map"
      APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
      IDLIST='dfincp,dnfincp,ffincp,fnfincp,absitcmahdfs'
      START='2010-01-01'
      END='2010-05-20'
      FREQ='q'
      OUTPUT=1
      FORMAT=xml;

   data diffNative_freqq
      set fred.fredex04;
   run;
   
   proc print data=diffNative_freqq; run;

You can reference the in-memory CAS table, M2MYFRED, as follows to save the data in a SASHDAT file, but do not specify the SASHDAT extension in the file name:

   proc casutil;
      save casdata="M2MYFRED" casout="<filename>" outcaslib='<outcaslib name>' 
      incaslib='<caslib name>' replace;
   quit;

To list the tables in the active caslib, specify the following:

   proc casutil; list; quit;
Last updated: June 19, 2025