<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Modify column length of table in a caslib in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971756#M2941</link>
    <description>&lt;P&gt;To be clear, the DATA step that changes variable length, i.e., the one that is the result of the CALL EXECUTE() function, does run in CAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: CALL EXECUTE generated line.
1     + data myCas.cars(replace=YES);retain
2     + Make
3     + Model
4     + Type
5     + Origin
6     + DriveTrain
7     + MSRP
8     + Invoice
9     + EngineSize
10    + Cylinders
11    + Horsepower
12    + MPG_City
13    + MPG_Highway
14    + Weight
15    + Wheelbase
16    + Length
17    + ; Length Model $ 128;set myCas.cars;run;
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000495 seconds
NOTE:       cpu time                0.000437 seconds (88.28%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  729.16K (0.00%)
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000513 seconds
NOTE:       cpu time                0.000477 seconds (92.98%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  725.88K (0.00%)
NOTE: Executing action 'table.columnInfo'.
NOTE: Action 'table.columnInfo' used (Total process time):
NOTE:       real time               0.000587 seconds
NOTE:       cpu time                0.000557 seconds (94.89%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  857.75K (0.00%)
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: Executing action 'sessionProp.getSessOpt'.
NOTE: Action 'sessionProp.getSessOpt' used (Total process time):
NOTE:       real time               0.000173 seconds
NOTE:       cpu time                0.000143 seconds (82.66%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  224.78K (0.00%)
NOTE: Executing action 'sessionProp.setSessOpt'.
NOTE: Action 'sessionProp.setSessOpt' used (Total process time):
NOTE:       real time               0.000576 seconds
NOTE:       cpu time                0.000498 seconds (86.46%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  297.06K (0.00%)
NOTE: The DATA step will run in multiple threads.
NOTE: Executing action 'dataStep.runBinary'.
NOTE: There were 428 observations read from the table CARS in caslib CASUSER(b.jablonski@mini.pw.edu.pl).
NOTE: The table cars in caslib CASUSER(b.jablonski@mini.pw.edu.pl) has 428 observations and 15 variables.
NOTE: Action 'dataStep.runBinary' used (Total process time):
NOTE:       real time               0.097909 seconds
NOTE:       cpu time                0.123906 seconds (126.55%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  42.90M (0.01%)
NOTE: Executing action 'sessionProp.setSessOpt'.
NOTE: Action 'sessionProp.setSessOpt' used (Total process time):
NOTE:       real time               0.000315 seconds
NOTE:       cpu time                0.000281 seconds (89.21%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  307.25K (0.00%)
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      cpu time            0.02 seconds
      &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So all data stay in CAS, there is no "&lt;EM&gt;read from CAS and written back to CAS&lt;/EM&gt;", right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only the one before, that using&amp;nbsp;&lt;CODE class=" language-sas"&gt;myCas.Varnum&lt;/CODE&gt;&amp;nbsp;and calling the CALL EXECUTE() runs in SAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;100    data _null_;
101      set myCas.Varnum END=_E_;
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000566 seconds
NOTE:       cpu time                0.000531 seconds (93.82%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  729.63K (0.00%)
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000498 seconds
NOTE:       cpu time                0.000459 seconds (92.17%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  730.38K (0.00%)
NOTE: Executing action 'table.columnInfo'.
NOTE: Action 'table.columnInfo' used (Total process time):
NOTE:       real time               0.000599 seconds
NOTE:       cpu time                0.000568 seconds (94.82%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  853.25K (0.00%)
102    
103      if _N_ = 1 then call execute(
104        'data myCas.cars(replace=YES);retain'
105        );
106      call execute(Variable);
107      if _E_ = 1 then call execute(
108        '; Length Model $ 128;' /* change length here */
109        || 'set myCas.cars;run;'
110        || 'proc delete data=myCas.Varnum; run;'
111        );
112    run;
NOTE: Could not execute DATA step code in Cloud Analytic Services. Running DATA step in the SAS client.
NOTE: Executing action 'table.fetch'.
NOTE: Action 'table.fetch' used (Total process time):
NOTE:       real time               0.001243 seconds
NOTE:       cpu time                0.001210 seconds (97.35%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  1.01M (0.00%)
NOTE: There were 15 observations read from the data set MYCAS.VARNUM.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Thu, 31 Jul 2025 09:56:27 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2025-07-31T09:56:27Z</dc:date>
    <item>
      <title>Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971681#M2933</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I want to modyfy the length of a column of my table in a casli without changing the order oaf variables.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 10:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971681#M2933</guid>
      <dc:creator>ajulio4</dc:creator>
      <dc:date>2025-07-30T10:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971684#M2934</link>
      <description>&lt;P&gt;how about just:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mySession sessopts=(caslib=casuser timeout=3600 locale="en_US" METRICS=TRUE);
options sessref=mySession;

libname myCAS cas caslib=casuser;

/* create sample data */
data myCas.cars(replace=YES);
  set sashelp.cars;
run;

/* metadata before */
ods trace on;
ods output Position=myCas.Varnum(replace=YES);
proc contents data = myCas.cars varnum;
run;
ods trace off;

data _null_;
  set myCas.Varnum END=_E_; 
  
  if _N_ = 1 then call execute(
    'data myCas.cars(replace=YES);retain'
    );
  call execute(Variable);
  if _E_ = 1 then call execute(
    '; Length Model $ 128;' /* change length here */
    || 'set myCas.cars;run;'
    || 'proc delete data=myCas.Varnum; run;'
    );
run;

/* metadata after */
proc contents data = myCas.cars varnum;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 10:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971684#M2934</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-07-30T10:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971686#M2935</link>
      <description>&lt;P&gt;I don't have CAS available here. Just wondering, wouldn't this work in CAS?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
alter table myCas.cars(replace=YES) modify model char(128);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jul 2025 11:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971686#M2935</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-07-30T11:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971696#M2936</link>
      <description>&lt;P&gt;That was my first attempt, but it gave me:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1753880639606.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108628iA4C5DB8B1F31D3CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1753880639606.png" alt="yabwon_0-1753880639606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same for FedSQL, but different error:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_1-1753881372595.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108630i4ADDF6DFCD95C6E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_1-1753881372595.png" alt="yabwon_1-1753881372595.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Looks like CAS is not supported format...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 13:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971696#M2936</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-07-30T13:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971708#M2937</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;, for testing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me that restrictions are a big topic when it comes to CAS (or FedSQL for that matter) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="xisDoc-shortDescription"&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/p12ohgh32ffm6un13s7l2d5p9c8y.htm" target="_blank" rel="noopener"&gt;PROC SQL Statement&lt;/A&gt;&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-restriction"&gt;Restriction:&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;This procedure is not supported on the CAS server.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;H1 id="p01g7hypc3gcujn11sbym6a0znm1" class="xisDoc-title"&gt;&lt;FONT size="3"&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/fedsqlref/p01g7hypc3gcujn11sbym6a0znm1.htm" target="_blank" rel="noopener"&gt;ALTER TABLE Statement&lt;/A&gt;&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class="xisDoc-shortDescription"&gt;(...)&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-restriction"&gt;Restrictions:&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;This statement is not supported in FedSQL programs that run in CAS.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;FONT size="3"&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/fedsqlref/p01g7hypc3gcujn11sbym6a0znm1.htm#n001q8voylycz6n1ojx0vpa4owb2" target="_blank" rel="noopener"&gt;ALTER [COLUMN]&lt;/A&gt; &amp;lt;column-definition&amp;gt; [,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-symbolHEllipsis"&gt;...&lt;/SPAN&gt;&amp;lt;column-definition&amp;gt;]&lt;/FONT&gt;&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&lt;FONT size="3"&gt;specifies to modify the definition of one or more columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-dataSource"&gt;Data source&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;Amazon Redshift, Aster, DB2 under UNIX and PC,&lt;SPAN&gt;&amp;nbsp;... &lt;EM&gt;[and several others, but NOT including "SAS data set"]&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 30 Jul 2025 14:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971708#M2937</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-07-30T14:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971743#M2940</link>
      <description>&lt;P&gt;I was wrong about this "The previous example with the DATA step runs on the compute server, all data will be read from CAS and written back to CAS. Depending on the size this may take some time." thanks for the correction&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The CAS server supports executing FedSQL, not all statements are supported see&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_065/casfedsql/p0ipyarz6fe3mvn1hc8ega07irv6.htm" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_065/casfedsql/p0ipyarz6fe3mvn1hc8ega07irv6.htm&lt;/A&gt;&amp;nbsp;for more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can make use of the casting functionality within FedSQL to change the length of char or varchar column. Below is an example program that does this. It is executing on the CAS server so no data transfer between CAS and compute.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
 * change length of a char/varchar column
 * one needs to make a copy of an existing table
 *
 * the create table does support the {options replace=true} table option
 * however FedSQL will always create a session scope table
 */
cas sugus sessopts=(caslib="casuser");

/*
 * load some sample data, has session scope
 */
proc casutil;
  load data=sashelp.cars casout="mycars" replace;
run;
quit;

title "columns before";
proc cas;
  action table.columninfo / table="mycars";
  run;
quit;
title;

proc cas;
  /*
    * build column expressions
    * we use the CAST()/:: function to change the length
    */
  action table.columninfo result=cols / table={caslib="casuser" name="mycars"};
  sqlCols=" ";
  do colInfo over cols.columnInfo;
    colName=colInfo.column;

    colExpression=colName;

    /* change as needed */
    if colName="Model" then do;
      colExpression=catx(" ", quote(colName), "::varchar(64) as", quote(colName));
    end;
    /* change as needed */
    if colName="DriveTrain" then do;
      colExpression=catx(" ", quote(colName), ":: varchar(32) as", quote(colName));
    end;

    sqlCols=catx(", ", sqlCols, colExpression);
  end;
  print(note) sqlCols;
  run;
  action table.droptable / caslib="casuser" name="mycars2" quiet=true;
  run;
  /*
    * create complete SQL statement
    * be aware that fedsql will always create a session scope table
    */
  sqlStmt=catx(" " , "create table casuser.mycars2 as select" , sqlCols ,
      "from casuser.mycars;" );
  print(note) sqlStmt;
  action fedsql.execdirect / query=sqlStmt;
  run;
quit;


title "columns after";
proc cas;
    action table.columninfo / table="mycars2";
    run;
quit;
title;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2025 10:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971743#M2940</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2025-07-31T10:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971756#M2941</link>
      <description>&lt;P&gt;To be clear, the DATA step that changes variable length, i.e., the one that is the result of the CALL EXECUTE() function, does run in CAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: CALL EXECUTE generated line.
1     + data myCas.cars(replace=YES);retain
2     + Make
3     + Model
4     + Type
5     + Origin
6     + DriveTrain
7     + MSRP
8     + Invoice
9     + EngineSize
10    + Cylinders
11    + Horsepower
12    + MPG_City
13    + MPG_Highway
14    + Weight
15    + Wheelbase
16    + Length
17    + ; Length Model $ 128;set myCas.cars;run;
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000495 seconds
NOTE:       cpu time                0.000437 seconds (88.28%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  729.16K (0.00%)
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000513 seconds
NOTE:       cpu time                0.000477 seconds (92.98%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  725.88K (0.00%)
NOTE: Executing action 'table.columnInfo'.
NOTE: Action 'table.columnInfo' used (Total process time):
NOTE:       real time               0.000587 seconds
NOTE:       cpu time                0.000557 seconds (94.89%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  857.75K (0.00%)
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: Executing action 'sessionProp.getSessOpt'.
NOTE: Action 'sessionProp.getSessOpt' used (Total process time):
NOTE:       real time               0.000173 seconds
NOTE:       cpu time                0.000143 seconds (82.66%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  224.78K (0.00%)
NOTE: Executing action 'sessionProp.setSessOpt'.
NOTE: Action 'sessionProp.setSessOpt' used (Total process time):
NOTE:       real time               0.000576 seconds
NOTE:       cpu time                0.000498 seconds (86.46%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  297.06K (0.00%)
NOTE: The DATA step will run in multiple threads.
NOTE: Executing action 'dataStep.runBinary'.
NOTE: There were 428 observations read from the table CARS in caslib CASUSER(b.jablonski@mini.pw.edu.pl).
NOTE: The table cars in caslib CASUSER(b.jablonski@mini.pw.edu.pl) has 428 observations and 15 variables.
NOTE: Action 'dataStep.runBinary' used (Total process time):
NOTE:       real time               0.097909 seconds
NOTE:       cpu time                0.123906 seconds (126.55%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  42.90M (0.01%)
NOTE: Executing action 'sessionProp.setSessOpt'.
NOTE: Action 'sessionProp.setSessOpt' used (Total process time):
NOTE:       real time               0.000315 seconds
NOTE:       cpu time                0.000281 seconds (89.21%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  307.25K (0.00%)
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      cpu time            0.02 seconds
      &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So all data stay in CAS, there is no "&lt;EM&gt;read from CAS and written back to CAS&lt;/EM&gt;", right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only the one before, that using&amp;nbsp;&lt;CODE class=" language-sas"&gt;myCas.Varnum&lt;/CODE&gt;&amp;nbsp;and calling the CALL EXECUTE() runs in SAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;100    data _null_;
101      set myCas.Varnum END=_E_;
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000566 seconds
NOTE:       cpu time                0.000531 seconds (93.82%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  729.63K (0.00%)
NOTE: Executing action 'table.tableInfo'.
NOTE: Action 'table.tableInfo' used (Total process time):
NOTE:       real time               0.000498 seconds
NOTE:       cpu time                0.000459 seconds (92.17%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  730.38K (0.00%)
NOTE: Executing action 'table.columnInfo'.
NOTE: Action 'table.columnInfo' used (Total process time):
NOTE:       real time               0.000599 seconds
NOTE:       cpu time                0.000568 seconds (94.82%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  853.25K (0.00%)
102    
103      if _N_ = 1 then call execute(
104        'data myCas.cars(replace=YES);retain'
105        );
106      call execute(Variable);
107      if _E_ = 1 then call execute(
108        '; Length Model $ 128;' /* change length here */
109        || 'set myCas.cars;run;'
110        || 'proc delete data=myCas.Varnum; run;'
111        );
112    run;
NOTE: Could not execute DATA step code in Cloud Analytic Services. Running DATA step in the SAS client.
NOTE: Executing action 'table.fetch'.
NOTE: Action 'table.fetch' used (Total process time):
NOTE:       real time               0.001243 seconds
NOTE:       cpu time                0.001210 seconds (97.35%)
NOTE:       total nodes             1 (64 cores)
NOTE:       total memory            503.87G
NOTE:       memory                  1.01M (0.00%)
NOTE: There were 15 observations read from the data set MYCAS.VARNUM.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2025 09:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971756#M2941</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-07-31T09:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971759#M2942</link>
      <description>Yes, I forgot about that when input and outout are both from CAS it runs in CAS, thanks for the correction. I will make a change to my post.</description>
      <pubDate>Thu, 31 Jul 2025 10:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971759#M2942</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2025-07-31T10:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modify column length of table in a caslib</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971760#M2943</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt;&amp;nbsp;your code inspired me (thank you!!) to try one more approach. It runs 100% CAS, and it seems pretty to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mySession sessopts=(caslib=casuser timeout=3600 locale="en_US" METRICS=TRUE);
options sessref=mySession msglevel=i;

libname myCAS cas caslib=casuser;
/* create sample data */
data myCas.cars(replace=YES);
  set sashelp.cars;
run;


proc cas;
  action table.columninfo result=c / table="cars";

  dataStep.runCode status=rc/
    code = 'data casuser.cars(replace=YES);retain '
        || catx(" ",c.ColumnInfo[,"Column"]) 
        || '; Length Model $ 128;' /* change length here */
        || 'set casuser.cars;run;'
  ;
  print rc;
  run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2025 10:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Modify-column-length-of-table-in-a-caslib/m-p/971760#M2943</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-07-31T10:24:42Z</dc:date>
    </item>
  </channel>
</rss>

