<?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: CAS Table defintion in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880835#M1859</link>
    <description>&lt;P&gt;When the data set is loaded to CAS, you can convert the character strings to varchar to save on memory.&amp;nbsp;&amp;nbsp;Another option is to compress the table.&amp;nbsp; In this example, I specified strings $16 and greater be converted with the compress option commented out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   length x $10000 y $8;
   x='abcdefghijk';
   y='abcdefgh';
run;

* Load SAS data set from the client;
%let path=%sysfunc(pathname(WORK));
proc casutil outcaslib="CASUSER";
   load file="&amp;amp;path./test.sas7bdat" importoptions=(filetype="BASESAS" varcharconversion=16) casout="test" /*compress*/;
quit;

proc cas;
   table.columninfo / table={caslib="CASUSER" name="test"};
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="columns.PNG" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85013i52AE3AD788F26196/image-size/large?v=v2&amp;amp;px=999" role="button" title="columns.PNG" alt="columns.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2023 22:23:09 GMT</pubDate>
    <dc:creator>DerylHollick</dc:creator>
    <dc:date>2023-06-14T22:23:09Z</dc:date>
    <item>
      <title>CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880134#M1848</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;we are using SaS Viya and CAS, and for some data preparation tasks my peers use proc sql (create table as select col1, col2 ... from table2).&amp;nbsp; Once I checked the automatically created tables, these always use the Data type CHAR(n) fixed length string for text/character attributes. This causes a very big table in CAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am Data Engineer, if I create a new Table on a database (sql,nosql, streaming), i will always define a DDL (Data definition language) script with exact data types and length for the table. But I didn't find official documents from SAS for this, in most of Example the tables will be just created by data step, CASl, Proc SQL/Fedsql&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are your strategies for creating &amp;amp; managing Tables in CAS?&amp;nbsp; Do you use a DDL for a new Table? Have you some best practices?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 07:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880134#M1848</guid>
      <dc:creator>Woo23</dc:creator>
      <dc:date>2023-06-12T07:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880141#M1850</link>
      <description>&lt;P&gt;e.g. some database table lifecycle process that I used.&lt;/P&gt;&lt;P&gt;1. writing DDL with Columns, Datatypes, Length for the new table&lt;/P&gt;&lt;P&gt;2. using DB-Provisioning tools like flyway, liquibase, sql server db-project promote the table in dev, test, prod database&lt;/P&gt;&lt;P&gt;3. inserting/updating data on the table that be created in step 2&lt;/P&gt;&lt;P&gt;4. using the table to writing/reading the data (e.g. training datasets, oltp/olap tables)&lt;/P&gt;&lt;P&gt;5. changing some columns backward compatible, and using DB-Provisiong tools to deploy the change into the existing tables&lt;/P&gt;&lt;P&gt;6. if the table is not be used, then write DDL-Script to drop the table with DB-Provisioning tools.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because CAS is one in-memory db, i think, we should design the cas table carefully and use the smallest data length for columns.&lt;/P&gt;&lt;P&gt;How do you do this on SAS CAS in-memory DB?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 08:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880141#M1850</guid>
      <dc:creator>Woo23</dc:creator>
      <dc:date>2023-06-12T08:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880161#M1851</link>
      <description>&lt;P&gt;Using DDL's is one of many ways of creating data sets in CAS. But this is perhaps not a technical issue.&lt;/P&gt;
&lt;P&gt;The question I think is relevant is who creates data sets in CAS, and for what purposes.&lt;/P&gt;
&lt;P&gt;Generally speaking, analysts that uses data for ad-hoc reporting are usually not that concerned about data modelling. In this scenario I suggest some kind of educational approach.&lt;/P&gt;
&lt;P&gt;For data used in applications such as VA, VS and others, you should have a better control on your data design and require that this data to be modelled according to your guidelines.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 07:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880161#M1851</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-16T07:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880171#M1852</link>
      <description>&lt;P&gt;Thanks for your Answer and suggestion!&lt;/P&gt;&lt;P&gt;yes, you are right!&amp;nbsp; The most of data analysts use and analyze the data, but they don't design the data model for VA, Data&amp;amp;Feature-Sets.&lt;/P&gt;&lt;P&gt;The big problem on SAS SQL Proc ist,&amp;nbsp; Data types and Data length for the automatically generated columns are too big, something like char(400), char(10000)... with fixed length string,&amp;nbsp;&amp;nbsp; with multiple million records, this will overburden the memory usages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have some examples/guidelines for automating the table deployment/provisionieng like on Database/Streaming app?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 11:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880171#M1852</guid>
      <dc:creator>Woo23</dc:creator>
      <dc:date>2023-06-12T11:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880835#M1859</link>
      <description>&lt;P&gt;When the data set is loaded to CAS, you can convert the character strings to varchar to save on memory.&amp;nbsp;&amp;nbsp;Another option is to compress the table.&amp;nbsp; In this example, I specified strings $16 and greater be converted with the compress option commented out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   length x $10000 y $8;
   x='abcdefghijk';
   y='abcdefgh';
run;

* Load SAS data set from the client;
%let path=%sysfunc(pathname(WORK));
proc casutil outcaslib="CASUSER";
   load file="&amp;amp;path./test.sas7bdat" importoptions=(filetype="BASESAS" varcharconversion=16) casout="test" /*compress*/;
quit;

proc cas;
   table.columninfo / table={caslib="CASUSER" name="test"};
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="columns.PNG" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85013i52AE3AD788F26196/image-size/large?v=v2&amp;amp;px=999" role="button" title="columns.PNG" alt="columns.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 22:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/880835#M1859</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2023-06-14T22:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/881063#M1862</link>
      <description>&lt;P&gt;thanks for your answer!&lt;/P&gt;&lt;P&gt;I asked the quetison, because I want to manage the globale CAS tables with version control system, these should automatically and &lt;SPAN class=""&gt;audit-proof&amp;nbsp;&lt;/SPAN&gt;be created from deployment pipeline / SAS-Scripts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think creating/promoting a cas global table with data step&amp;nbsp;or create table x select x from table1 un-controled is not safe, can cause some unexcepted problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have some best practices for CAS data/schema management like we did in other data systems (Database, apache Kafka, arvo usw..) ?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 08:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/881063#M1862</guid>
      <dc:creator>Woo23</dc:creator>
      <dc:date>2023-06-16T08:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883022#M1869</link>
      <description>&lt;P&gt;CAS is an in-memory engine, but it is not a DBMS with schema/DDL requirements.&amp;nbsp; "Loading data to CAS" usually refers to loading into memory, but a CASLIB also defines the "permanent" or "physical" location of the data.&amp;nbsp; A&amp;nbsp;DBMS might be chosen for this location, depending&amp;nbsp;on the requirements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a pipeline-type process, I like to centralize all the CAS loads and use proc casutil.&amp;nbsp; This allows me to check all the column type/lengths, table sizes, decide whether to compress, etc.&amp;nbsp; If loading *.sas7bdat files from a Viya or SAS9 compute server, I usually use the varcharconversion option, as well as save the tables to *.sashdat files, so they can be easily reloaded without having to rerun the process.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 22:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883022#M1869</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2023-06-29T22:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883244#M1871</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/359904"&gt;@Woo23&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;From your first post I see this&lt;BR /&gt;"&lt;SPAN&gt;&lt;EM&gt;we are using SaS Viya and CAS, and for some data preparation tasks my peers use proc sql (create table as select col1, col2 ... from table2).&amp;nbsp; Once I checked the automatically created tables, these always use the Data type CHAR(n) fixed length string for text/character attributes. &lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;This causes a very big table in CAS&lt;/EM&gt;.&lt;/STRONG&gt;'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The basic fact is that SAS is general and Proc SQL in particular does not support varchar data format. All character fields are fixed length. So have realistic&amp;nbsp;expectations on data set sizes. The manner in which tables are created does not matter.&lt;BR /&gt;The SAS Proc FEDQL - the federated&amp;nbsp;query language procedure for querying&amp;nbsp;RDBMS databases supports varchar format. But his may not be of any help in your case.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2023 14:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883244#M1871</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-07-02T14:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883286#M1873</link>
      <description>&lt;P&gt;we use the cas database, this support Varchar. this isn't like SAS 9.4, there are just number and char data types. Proc SQL only know these 2 datatype, but if we use proc fedsql, we can create the table with varchar in CAS-Session. What we need, is a datamanagement Guide in CAS, how one table version-safely created, modified und dropped...&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 06:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883286#M1873</guid>
      <dc:creator>Woo23</dc:creator>
      <dc:date>2023-07-03T06:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883422#M1877</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3174"&gt;@DerylHollick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What version of SAS are you using ? varcharconversion= seems to be ignored in my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 11:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883422#M1877</guid>
      <dc:creator>nvdwalt</dc:creator>
      <dc:date>2023-07-04T11:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883425#M1878</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nvdwalt_0-1688470245421.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85544iE4DA3F7430E6B64D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nvdwalt_0-1688470245421.png" alt="nvdwalt_0-1688470245421.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 11:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883425#M1878</guid>
      <dc:creator>nvdwalt</dc:creator>
      <dc:date>2023-07-04T11:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883875#M1887</link>
      <description>&lt;P&gt;I used 3.5.&amp;nbsp; Your types show as varchar, so it wasn't ignored.&amp;nbsp; I get a similar result when running on Viya 4.&amp;nbsp; It looks like columnInfo shows the max actual length in 3.5 and the max possible length in 4.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents shows this for both 3.5 and 4:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="contents.PNG" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85632iF49FDD387DDFB086/image-size/large?v=v2&amp;amp;px=999" role="button" title="contents.PNG" alt="contents.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 00:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883875#M1887</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2023-07-07T00:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: CAS Table defintion</title>
      <link>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883893#M1888</link>
      <description>Awesome, thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3174"&gt;@DerylHollick&lt;/a&gt; !!&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Jul 2023 07:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/CAS-Table-defintion/m-p/883893#M1888</guid>
      <dc:creator>nvdwalt</dc:creator>
      <dc:date>2023-07-07T07:54:56Z</dc:date>
    </item>
  </channel>
</rss>

