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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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