BookmarkSubscribeRSS Feed
phopkinson
Calcite | Level 5

Hi,

 

I am trying to run some code in compute but am struggling with the runtimes, have tried running the code in CAS but it is coming up with an error, does CAS support the use of macros or not because my process largely relies arrays and macros?

6 REPLIES 6
Mazi
Pyrite | Level 9
Hi, Unfortunately Macros do not execute on the CAS server. https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/mcrolref/n0ch1ei5629ioxn13clvseqif3wi.htm
Are you able to identify why your code is not executing speedily?
Are your input tables large? searching through an unindexed dataset?
phopkinson
Calcite | Level 5

Ok, so do macro variables resolve in CAS or not?

Mazi
Pyrite | Level 9
%macro test(name=);
	libname casuser cas caslib="casuser";
	data casuser.test;
		x=1;
		name="&name";
	run;
%mend test;
%test(name=John Doe)
MPRINT(TEST):   data casuser.test;
MPRINT(TEST):   x=1;
MPRINT(TEST):   name="John Doe";
MPRINT(TEST):   run;
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: The DATA step has no input data set and will run in a single thread.
NOTE: The table test in caslib CASUSER(XXXXX) has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.52 seconds
      cpu time            0.05 seconds

Does this answer your question?

phopkinson
Calcite | Level 5

Thanks that's helpful, I'm quite new in terms of using Viya so some of this probably seems quite a dumb question but I do appreciate it.

Mazi
Pyrite | Level 9

No problem at all. If you can share more about what errors you are facing maybe we can advise you accordingly.

Rick_SAS
SAS Super FREQ

For a discussion of the DATA step and which functions can run in CAS, see the article,

"A list of SAS DATA step functions that do not run in CAS"