Het onderstaande script laat het verschil zien tussen het promoten van een SAS-dataset vanuit een fileserver library (WORK) en vanuit een CAS library (CASUSER). Het is om verschillende redenen handig om beide manieren te kennen:
/*
Author: Paul Koot
Created on: 2022/01/06
Goal script: Show differences into loading and promoting data in-memory (to CASLIB
named 'SHARED') from:
1. fileserver library (WORK)
2. CAS library (CASUSER)
Dependencies: - */
/* Initiate CAS session to be able to access the CASLIBS */
cas MySession;
caslib _all_ assign;
/* Load sample dataset into local WORK for this demo */
data WORK.class;
set SASHELP.class;
run;
/*=================================================
1. DROP ORIGINAL TABLE IN TARGET CASLIB,
2. LOAD AND PROMOTE WORK TABLE AND
3. SAVE A .SASHDAT FILE TO THE SERVER (CASE SENSITIVE!)
*===============================================*/
proc casutil;
droptable incaslib="SHARED" casdata="class" quiet;
load data=WORK.class outcaslib="SHARED" casout="class" promote;
save incaslib="SHARED" casdata="class" outcaslib="SHARED" casout="class" replace;
quit;
/* Load sample dataset into local CASUSER for this demo */
data CASUSER.class;
set SASHELP.class;
run;
/*=================================================
1. DROP ORIGINAL TABLE IN TARGET CASLIB,
2. LOAD AND PROMOTE CASUSER TABLE (THIS LINE IS DIFFERENT THAN FOR WORK) AND
3. SAVE A .SASHDAT FILE TO THE SERVER (CASE SENSITIVE!)
*===============================================*/
proc casutil;
droptable incaslib="SHARED" casdata="class" quiet;
promote incaslib="CASUSER" casdata="class" outcaslib="SHARED" casout="class";
save incaslib="SHARED" casdata="class" outcaslib="SHARED" casout="class" replace;
quit;
cas MySession terminate;