Hello,
I'm trying to use the PROC CPANEL method in the SAS Viya Learner environment and keep receiving a LIBREF error. Could someone help point me in the right direction? I'm use to using SAS Studio for Academics so this is a new environment for me.
/* Generated Code (IMPORT) */
/* Source File: EmpiricalPaperData.csv */
/* Source Path: /shared/home/X@X.edu/casuser/EmpiricalPaperData.csv */
/* Code generated on: Jul 8, 2023, 5:41:06 PM */
proc sql;
%if %sysfunc(exist(WORK.paper1)) %then %do;
drop table WORK.paper1;
%end;
%if %sysfunc(exist(WORK.paper1,VIEW)) %then %do;
drop view WORK.paper1;
%end;
quit;
FILENAME REFFILE DISK '/shared/home/X@X.edu/casuser/EmpiricalPaperData.csv';
PROC IMPORT DATAFILE=REFFILE
DBMS=CSV
OUT=WORK.paper1;
GETNAMES=YES;
RUN;
PROC CONTENTS DATA=WORK.paper1; RUN;
proc sort data=WORK.paper1 out=WORK.paper1;
by CountryCode time;
run;
data WORK.paper1 (drop=VAR17 VAR18 VAR19);
set WORK.paper1;
/*Regional Dummies*/
dSA = 0; if Region="South Asia" then dSA=1;
dECA = 0; if Region="Europe & C" then dECA=1;
dMENA = 0; if Region="Middle Eas" then dMENA=1;
dSSA = 0; if Region="Sub-Sahara" then dSSA=1;
dLAC = 0; if Region="Latin Amer" then dLAC=1;
dEAP = 0; if Region="East Asia" then dEAP=1;
/*Income Group Dummies*/
dLI = 0; if IncomeGroup="Low income" then dLI=1;
dLMI = 0; if IncomeGroup="Lower midd" then dLMI=1;
dUMI = 0; if IncomeGroup="Upper midd" then dUMI=1;
/*global variables*/
lgdp = log(gdp);
loda = log(oda);
lpop = log(pop);
run;
proc sort data=WORK.paper1 out=WORK.paper1;
by CountryCode time;
run;
proc cpanel data=WORK.paper1;
id CountryCode time;
model PovIndex = lgdp loda curhealth_expn educ_expn goveffect / pooled cluster robust hccme=0;
run;Error:
211 proc cpanel data=WORK.paper1;
212 id CountryCode time;
213 model PovIndex = lgdp loda curhealth_expn educ_expn goveffect / pooled cluster robust hccme=0;
214 run;
ERROR: The data set WORK.PAPER1 must use a CAS engine libref.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CPANEL used (Total process time):
real time 0.00 seconds
cpu time 0.00 secondsThank you!
Hello,
Your input data set WORK.paper1 is not uploaded in-memory (in a CAS library).
"WORK" is an on-disk location.
If you use PROC PANEL (SAS/ETS) it will work.
PROC CPANEL (SAS Econometrics) is the distributed computing equivalent of PROC PANEL.
For PROC CPANEL the input data should be in a CAS Library (and not a classical V9 base on-disk library).
Data in a CAS library are distributed to different worker nodes (and different threads on these worker nodes).
SAS Viya has two compute engines :
PROC PANEL will run on SPRE (single-threaded).
PROC CPANEL will run on CAS (parallel computing).
If you absolutely want to use PROC CPANEL (instead of PROC PANEL), you can try this:
( PROC CPANEL has a few more features than PROC PANEL and on big data it will work faster )
cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");
caslib _all_ assign;
/*****************************************************************************/
/* Load SAS data set from a Base engine library (library.tableName) into */
/* the specified caslib ("myCaslib") and save as "targetTableName". */
/*****************************************************************************/
proc casutil;
load data=WORK.paper1 outcaslib="casuser"
casout="paper1_in_memory";
run; QUIT;
PROC CPANEL data=casuser.paper1_in_memory ...;
/* end of program */
Good luck,
Koen
Hello,
Your input data set WORK.paper1 is not uploaded in-memory (in a CAS library).
"WORK" is an on-disk location.
If you use PROC PANEL (SAS/ETS) it will work.
PROC CPANEL (SAS Econometrics) is the distributed computing equivalent of PROC PANEL.
For PROC CPANEL the input data should be in a CAS Library (and not a classical V9 base on-disk library).
Data in a CAS library are distributed to different worker nodes (and different threads on these worker nodes).
SAS Viya has two compute engines :
PROC PANEL will run on SPRE (single-threaded).
PROC CPANEL will run on CAS (parallel computing).
If you absolutely want to use PROC CPANEL (instead of PROC PANEL), you can try this:
( PROC CPANEL has a few more features than PROC PANEL and on big data it will work faster )
cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");
caslib _all_ assign;
/*****************************************************************************/
/* Load SAS data set from a Base engine library (library.tableName) into */
/* the specified caslib ("myCaslib") and save as "targetTableName". */
/*****************************************************************************/
proc casutil;
load data=WORK.paper1 outcaslib="casuser"
casout="paper1_in_memory";
run; QUIT;
PROC CPANEL data=casuser.paper1_in_memory ...;
/* end of program */
Good luck,
Koen
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!