<?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: Proc sql datatypes in create table statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929372#M365686</link>
    <description>&lt;P&gt;Thank you sir. If you can read the line that describe the data-type.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc_sql_data-types.png" style="width: 559px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96686i71C1B72EE16A3678/image-dimensions/559x447?v=v2" width="559" height="447" role="button" title="proc_sql_data-types.png" alt="proc_sql_data-types.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 08:54:59 GMT</pubDate>
    <dc:creator>PrinceAde</dc:creator>
    <dc:date>2024-05-23T08:54:59Z</dc:date>
    <item>
      <title>Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929243#M365635</link>
      <description>&lt;P&gt;Please I need clarifcation on the code below.&lt;BR /&gt;Thanks.&lt;/P&gt;
&lt;P&gt;"data-type bis enclosed in parentheses and specifies one of the following: CHARACTER (or CHAR) &lt;BR /&gt;| VARCHAR | INTEGER (or INT)."&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table work.discount &lt;BR /&gt;(Destination char(3),&lt;BR /&gt;BeginDate num Format=date9.,&lt;BR /&gt;EndDate num format=date9.,&lt;BR /&gt;Discount num);&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;I expect the data-type should be in parenthesis based on the syntax description above, e.g, Destination (char)(3).&lt;BR /&gt;Please what am I missing?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929243#M365635</guid>
      <dc:creator>PrinceAde</dc:creator>
      <dc:date>2024-05-22T14:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929244#M365636</link>
      <description>&lt;P&gt;I am not sure what "needs clarification".&lt;/P&gt;
&lt;P&gt;If you try to place the type in () as you suggest you generate multiple errors&lt;/P&gt;
&lt;PRE&gt;75   proc sql;
76   create table work.discount
77   (Destination (char)(3),
                  -      -
                  22     200
                  200
ERROR 22-322: Syntax error, expecting one of the following: CHAR, CHARACTER, DATE, DEC, DECIMAL,
              DOUBLE, FLOAT, INT, INTEGER, NUM, NUMERIC, REAL, SMALLINT, VARCHAR.

ERROR 200-322: The symbol is not recognized and will be ignored.

                           -
                           76
ERROR 76-322: Syntax error, statement will be ignored.

77 ! (Destination (char)(3),
                         -
                         22
ERROR 22-322: Syntax error, expecting one of the following: a name, keyword, CONSTRAINT.

77 ! (Destination (char)(3),
                           -
                           22
ERROR 22-322: Syntax error, expecting one of the following: CHAR, CHARACTER, DATE, DEC, DECIMAL,
              FLOAT, INT, INTEGER, NUM, NUMERIC, REAL, SMALLINT, VARCHAR.

78   BeginDate num Format=date9.,
79   EndDate num format=date9.,
80   Discount num);
81   quit;
&lt;/PRE&gt;
&lt;P&gt;The underscore above the 22 200 error shows that the "(" before the keyword CHAR is an error.&lt;/P&gt;
&lt;P&gt;The syntax is Variable type and length optional for CHAR variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you talking about the awkwardly phrased statement in quotes the parentheses are around the whole construct of ( variable1 type, variable2 type , variable3 type )&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929244#M365636</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-22T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929245#M365637</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;Yes it generated error. The documentation states that the&amp;nbsp; "&lt;SPAN&gt;data-type is enclosed in parentheses".&amp;nbsp;&lt;BR /&gt;The data-type for destination for example is char.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Is it that the documentation has been updated?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929245#M365637</guid>
      <dc:creator>PrinceAde</dc:creator>
      <dc:date>2024-05-22T14:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929246#M365638</link>
      <description>&lt;P&gt;Which documentation? Can you post a link to it?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_051/sqlproc/n0v236a0ti4nmen1mmw4gexjd0tg.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_051/sqlproc/n0v236a0ti4nmen1mmw4gexjd0tg.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Shows the syntax as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Column data-type &amp;lt;column-modifier(s)&amp;gt;&lt;/P&gt;
&lt;P&gt;no parentheses around data-type.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929246#M365638</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-22T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929252#M365639</link>
      <description>&lt;P&gt;Sorry, sir. I saw in the Text;&amp;nbsp;SAS® Certified Professional Prep Guide: Advanced Programming Using SAS® 9.4&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 15:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929252#M365639</guid>
      <dc:creator>PrinceAde</dc:creator>
      <dc:date>2024-05-22T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929338#M365667</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440493"&gt;@PrinceAde&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, sir. I saw in the Text;&amp;nbsp;SAS® Certified Professional Prep Guide: Advanced Programming Using SAS® 9.4&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;May-be share the section that confuses you and we can share how we understand it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS9.4 the only data types available for SAS tables are CHAR and NUMERIC. I didn't even know that Proc SQL allows for other datatypes - but they all result in type CHAR and NUM.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table work.sample
  (
    var1 char(20)
    ,var2 varchar(20)
    ,var3 integer
    ,var4 smallint
    ,var5 decimal
    ,var6 numeric
    ,var7 float(10,2)
    ,var8 real
    ,var9 double precision
    ,var10 date
  )
  ;
quit;

proc contents data=work.sample;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1716439653226.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96684i028A12E877827A72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1716439653226.png" alt="Patrick_0-1716439653226.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It looks like when requesting a DATE type SAS also adds a DATE. format which is useful.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 04:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929338#M365667</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-23T04:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929372#M365686</link>
      <description>&lt;P&gt;Thank you sir. If you can read the line that describe the data-type.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc_sql_data-types.png" style="width: 559px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96686i71C1B72EE16A3678/image-dimensions/559x447?v=v2" width="559" height="447" role="button" title="proc_sql_data-types.png" alt="proc_sql_data-types.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 08:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929372#M365686</guid>
      <dc:creator>PrinceAde</dc:creator>
      <dc:date>2024-05-23T08:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929396#M365701</link>
      <description>&lt;P&gt;You can report this mistaken wording to SAS and they will fix it pretty quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each documentation page includes a FEEDBACK link which will open a email message directed to the documentation support team.&amp;nbsp; They are very responsive.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 13:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929396#M365701</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-23T13:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql datatypes in create table statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929405#M365704</link>
      <description>&lt;P&gt;Do note that the line in the body of that starts Column-definition under the Column-specification &lt;STRONG&gt;does not show () around data type&lt;/STRONG&gt;. Note that&amp;nbsp; it does show the () around the conditional width. So if the code should be (char)(3) the line would have shown the () around the data type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data-type lines do not match the syntax at the header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tend to pay a bit more attention to the syntax statement examples at the start of section than the detail text as quite often when I'm looking at such documents I need a refresher and not reading from scratch.&amp;nbsp; I have also in the past resolved a few such discrepancies between diagrams and text that was a tad confusing (Sortseq options in Proc sort for example when they first came out)&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 14:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-datatypes-in-create-table-statement/m-p/929405#M365704</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-23T14:58:39Z</dc:date>
    </item>
  </channel>
</rss>

