Back to Tech Corner
SAS Programming

SAS Programming – How to Create Data for a Different OS

In some cases we may need to provide data to a downstream process or a consumer who is running SAS in an operating system that is different from ours. If data is simply processed and sent out, the first time that data is processed, SAS will use Cross-Environment Data Access (CEDA) to read in the document and once that data is output to a permanent storage, the data will be saved in the native OS format of the new environment. This is acceptable for a one off situation or where the data volume is reasonable and would not tax the processing environment since the first time process will use additional processing time and increased memory & computing resources.

Where the data processing is frequent and or data volume is high, it make sense to use a SAS feature called OUTREP; both a data step option for converting single datasets and or libname option to convert a bunch of sas datasets in a libname collection.

In this tip we would like to prepare our data to be SOLARIS ready while processing on a Linux Red Hat 8.7 OS. Following are the different SOLARIS OS available:

OptionDescription
SOLARIS_32Solaris on SPARC 32-bit platform
SOLARIS_64Solaris on SPARC 64-bit platform
SOLARIS_X86_64Solaris on x64 64-bit platform

Following is an example of converting Linux RHEL 8 data representation to a Solaris SPARC and Solaris x64 data representation.

/* create Solaris data format ready data */
/* processed on a Linux RHEL 8.7 OS */
/* establish libname for Solaris SPARC */
libname solsp '/data/solsparc64' ;
/* establish libnames for solaris x64 */
libname solsx '/data/solx64';
/* data prep for solaris sparc x64 solaris */
data solsp.solsparc(outrep=SOLARIS_64);
set SASHELP.CLASS;
run;
/* data prep for solari x64 solaris */
data solsx.solaris(outrep=SOLARIS_X86_64);
set SASHELP.CLASS;
run;

Log (Partial shown)

35 /* data prep for solaris sparc x64 solaris */
36 data solsp.solsparc(outrep=SOLARIS_64);
37 set SASHELP.CLASS;
38 run;
NOTE: Data file SOLSP.SOLSPARC.DATA is in a format that is native to
another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might
require additional CPU resources and might reduce
performance.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set SOLSP.SOLSPARC has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.02 seconds

40 /* data prep for solari x64 solaris */
41 data solsx.solaris(outrep=SOLARIS_X86_64);
42 set SASHELP.CLASS;
43 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set SOLSX.SOLARIS has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds