BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
jselland
Calcite | Level 5

 

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 seconds

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

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 :

  • The SAS Programming Runtime Environment (SPRE) is also referred to as the compute
    server in SAS Viya. You can think of this engine as a SAS Workspace Server (like the one in SAS 9.4).
  • The second compute engine is CAS. The CAS engine is an in-memory engine. This means
    that the data is in memory and spread across all threads on all CAS worker nodes. The
    processing of this in-memory data is distributed across all the threads and happens in
    parallel. This can reduce run times of CAS enabled procedures and DATA Steps.

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

View solution in original post

1 REPLY 1
sbxkoenk
SAS Super FREQ

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 :

  • The SAS Programming Runtime Environment (SPRE) is also referred to as the compute
    server in SAS Viya. You can think of this engine as a SAS Workspace Server (like the one in SAS 9.4).
  • The second compute engine is CAS. The CAS engine is an in-memory engine. This means
    that the data is in memory and spread across all threads on all CAS worker nodes. The
    processing of this in-memory data is distributed across all the threads and happens in
    parallel. This can reduce run times of CAS enabled procedures and DATA Steps.

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

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 270 views
  • 0 likes
  • 2 in conversation