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

Dear SAS community,

 

I would like to know how to use MAXTABLEMEM in a code in SAS Studio in SAS Viya, I was trying  like that :

 

cas mySession sessopts=( caslib=casuser timeout=1800 locale="en_US" MAXTABLemem=8G);

 

But it gives error:

ERROR: The syntax for CASSESSOPTS requires specification of one or more name=value combinations. The entire set of combinations
must be within parenthesis.

 

Pls advise.

 

Karolina

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_j
SAS Employee

Okay, in that case you can use below code snippet to check the options in a session:

cas cas1 sessopts=(maxtablemem="16M");                                     
proc cas;
   session cas1;
   sessionProp.listSessOpts result=r;             
run;
   print r.SessOpts[, {"Name", "Type", "Value"}]; 
run;
quit;

cas cas2 sessopts=(maxtablemem="32M");
proc cas;
   session cas2;
   sessionProp.listSessOpts result=r;             
run;
   print r.SessOpts[, {"Name", "Type", "Value"}];
run;
quit;

 

You should see that the output varies for sessions with different values of the maxtablemem option.

 

View solution in original post

8 REPLIES 8
Mike_j
SAS Employee

Hi Karolina,

 

I believe you need to put the 8G in plings like below:

cas mySession sessopts=( caslib=casuser timeout=1800 locale="en_US" MAXTABLemem="8G");

 

Mike

touwen_k
Pyrite | Level 9
Thank you, then cas accepts it. However when running this code below for different MAXTABLemem, I do not have a different number of blocks. Therefore I do not know if cas is really changing the size of the blocks. Pls advise.

It can be any table you have loaded to memery, important part of code is as below, it gives info about the memory blocks.
table.tableInfo / table="iris";
table.tableDetails / table="iris"
------------------------------------------------------------------
proc cas;
session casauto;

/* Load source data (IRIS) into a table. */
table.loadTable /
path="iris.sashdat"
casout={name="iris"};
run;

table.tableInfo / table="iris";
table.tableDetails / table="iris";
quit;
touwen_k
Pyrite | Level 9

Thank you, then cas accepts it. However when running this code below for different MAXTABLemem, I do not have a different number of blocks. Therefore I do not know if cas is really changing the size of the blocks. Pls advise.

It can be any table you have loaded to memery, important part of code is as below, it gives info about the memory blocks.
table.tableInfo / table="iris";
table.tableDetails / table="iris"
------------------------------------------------------------------
proc cas;
session casauto;

/* Load source data (IRIS) into a table. */
table.loadTable /
path="iris.sashdat"
casout={name="iris"};
run;

table.tableInfo / table="iris";
table.tableDetails / table="iris";
quit;

Mike_j
SAS Employee

I am a bit unsure what it is you want to accomplish.

 

Do you want to distribute the dataset across worker nodes differently? load the dataset to a single worker node? something else?

 

Here is a link to an article that describes the maxtablemem in more details:

Dr. StrangeRAM or: How I learned to stop worrying and love CAS - SAS Users

 

Mike

touwen_k
Pyrite | Level 9
Thank you for the article, I could not find much about the memory blocks. I have read that when loading a large table, it is recommended to set block from 16MB to larger. This can be done in session options with quotation marks as you advised.
How to check that this option works, that it is changed from 16 MB to 256MB, with which commando? If I suggested a wrong commando, it is because I do not know which one to use.
Mike_j
SAS Employee

Okay, in that case you can use below code snippet to check the options in a session:

cas cas1 sessopts=(maxtablemem="16M");                                     
proc cas;
   session cas1;
   sessionProp.listSessOpts result=r;             
run;
   print r.SessOpts[, {"Name", "Type", "Value"}]; 
run;
quit;

cas cas2 sessopts=(maxtablemem="32M");
proc cas;
   session cas2;
   sessionProp.listSessOpts result=r;             
run;
   print r.SessOpts[, {"Name", "Type", "Value"}];
run;
quit;

 

You should see that the output varies for sessions with different values of the maxtablemem option.

 

touwen_k
Pyrite | Level 9
Thank you very much for providing clarity on this topic. It works.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1803 views
  • 2 likes
  • 2 in conversation