Navigating between the SAS Compute Server (traditional SAS) and the CAS Server (Cloud Analytic Services) requires a clear understanding of where your data "lives" and how it moves. The true power of SAS Viya lies in the ability to bridge these two environments seamlessly, but efficiency depends on how you handle memory and threading.
To verify where your DATA step is executing, check the SAS Log for the message: "The SAS System stopped processing this step because of errors" (which may indicate a CAS-incompatible function) or look for notes regarding "Running in CAS". If you don't see CAS-specific notes, your data is being pulled back to the local Compute Server, which can drastically slow down processing on large datasets.
Type : CREATION_INTERNE
The first example reads a CSV file from an external URL provided in the example, and the second example generates data internally using a DATA step.
| 1 | filename names url |
| 2 | "http://support.sas.com/documentation/onlinedoc/viya/exampledatasets/names.csv"; |
| 3 | |
| 4 | DATA mycas.names; |
| 5 | INFILE names dsd truncover firstobs=2; |
| 6 | INPUT BRTH_YR :$10. GNDR :$10. ETHCTY :$10. NM :$10. |
| 7 | CNT :$10. RNK :$10.; |
| 8 | RUN; |
| 9 | |
| 10 | PROC CASUTIL incaslib='casuser'; |
| 11 | save casdata='names' outcaslib='casuser' replace; |
| 12 | list; |
| 13 | RUN; |
| 1 | cas casauto sessopts=(caslib='casuser'); |
| 2 | LIBNAME mycas cas; |
| 3 | caslib _all_ assign; |
| 4 | |
| 5 | DATA mycas.earnings; |
| 6 | Amount=1000; |
| 7 | Rate=.075/12; |
| 8 | DO month=1 to 12; |
| 9 | Earned +(amount+earned)*(rate); |
| 10 | END; |
| 11 | RUN; |
| 12 | PROC PRINT DATA=mycas.earnings; |
| 13 | RUN; |
| 14 | |
| 15 | LIBNAME mySAS "u/user/myfiles/"; |
| 16 | |
| 17 | DATA mySAS.earnings; |
| 18 | SET mycas.earnings; |
| 19 | RUN; |
