The script begins by initializing the CAS session and assigning all available CASLIBs. Then, it uses a DATA STEP to copy the 'sashelp.baseball' dataset to a new CAS table named 'baseball_stats' in the 'casuser' CASLIB. Once the data is in CAS, 'PROC MEANS' is executed on 'casuser.baseball_stats' to calculate descriptive statistics. Finally, the script lists the complete history of CAS session actions, which is useful for debugging and auditing.
Data Analysis
Type : SASHELP
The source dataset 'sashelp.baseball' is an internal table provided by SAS. It is loaded into the 'casuser' CAS library before being used for analysis.
1 Code Block
CAS Session Management
Explanation : These commands initialize a CAS session and assign all available CAS libraries (CASLIBs), making CAS tables accessible for processing.
Copied!
cas;
caslib _all_ assign;
1
cas;
2
caslib _all_ assign;
2 Code Block
DATA STEP Data
Explanation : This DATA STEP creates a new CAS table named 'baseball_stats' in the 'casuser' CASLIB. It copies data from the SASHELP dataset 'sashelp.baseball' into this new table. The execution of this DATA STEP occurs on the CAS server.
Copied!
data casuser.baseball_stats;
set sashelp.baseball;
run;
1
2
DATA casuser.baseball_stats;
3
SET sashelp.baseball;
4
RUN;
5
3 Code Block
PROC MEANS
Explanation : The MEANS procedure is executed on the CAS table 'casuser.baseball_stats' to generate descriptive statistics (such as mean, minimum, maximum, standard deviation) for all numeric variables present in the table.
Copied!
proc means data=casuser.baseball_stats;
run;
1
PROC MEANSDATA=casuser.baseball_stats;
2
RUN;
4 Code Block
CAS Action
Explanation : This CAS action lists the complete history of operations and actions executed in the 'casauto' CAS session. It is a useful tool for tracing and debugging CAS processes.
Copied!
cas casauto listhistory _all_;
1
cas casauto listhistory _all_;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.