<?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: salary float datatype in proc sql in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596764#M76212</link>
    <description>&lt;P&gt;And only store values as numbers that will/can be used for calculations. Wasting 8 numeric bytes for a three-character ID is nonsense.&lt;/P&gt;
&lt;P&gt;And if you have longer ID's, numeric will sooner or later have precision issues, and it can't deal correctly with leading zeroes.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 07:05:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-10-16T07:05:04Z</dc:date>
    <item>
      <title>salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596742#M76208</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table employeesdata
    (employee_id         num,
    first_name           char(15) ,
    last_name            char(18),  
    email                char(18) ,
    phone_number         num(20)    ,
    hire_date            date format=date9., 
    job_id               char(12) ,     
    salary               decimal(12,2),  
    commission_pct       num format=16.2, 
    manager_id           num,  
    department_id        num);

insert into employeesdata values (100  'Steven '      'King'         'SKING'     515.123.4567        '2003-06-17'  'ADPRES'     24000.00            0.00           0             90 );
insert into employeesdata values (101 ' Neena'        'Kochhar'      'NKOCHHAR'  515.123.4568        '2005-09-21'  'ADVP'       17000.00            0.00         100             90 );
insert into employeesdata values (102  'Lex'          'De Haan'      'LDEHAAN'   515.123.4569        '2001-01-13'  'ADVP'       17000.00            0.00         100             90 );
insert into employeesdata values (103  'Alexander'    'Hunold'       'AHUNOLD'   590.423.4567        '2006-01-03'  'ITPROG'      9000.00            0.00         102             60 );
insert into employeesdata values (104  'Bruce'        'Ernst'        'BERNST'    590.423.4568        '2007-05-21'  'ITPROG'      6000.00            0.00         103             60 );
insert into employeesdata values (105  'David'        'Austin'       'DAUSTIN'   590.423.4569        '2005-06-25'  'ITPROG'      4800.00            0.00         103             60 );
insert into employeesdata values (106  'Valli'        'Pataballa'    'VPATABAL'  590.423.4560        '2006-02-05'  'ITPROG'      4800.00            0.00         103             60 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Table created&amp;nbsp; why it shows error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: VALUES clause 1 attempts to insert more columns than specified after the INSERT&lt;BR /&gt;table name.&lt;BR /&gt;ERROR: Value 8 of VALUES clause 1 does not match the data type of the corresponding&lt;BR /&gt;column in the object-item list (in the SELECT clause).&lt;BR /&gt;490 insert into employeesdata values (101 ' Neena' 'Kochhar' 'NKOCHHAR'&lt;BR /&gt;490! 515.123.4568 '2005-09-21' 'ADVP' 17000.00 0.00 100&lt;BR /&gt;490! 90 );&lt;BR /&gt;ERROR: VALUES clause 1 attempts to insert more columns than specified after the INSERT&lt;BR /&gt;table name.&lt;BR /&gt;ERROR: Value 8 of VALUES clause 1 does not match the data type of the corresponding&lt;BR /&gt;column in the object-item list (in the SELECT clause).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 04:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596742#M76208</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-10-16T04:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596746#M76209</link>
      <description>&lt;P&gt;A phone number is NOT a number, so the variable (aka column in SQL speak) is defined wrong, or named wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;515.123.4567 is also NOT a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would normally use commas between the items in a VALUES statement (SQL really likes commas, on of the reasons it is such a pain to use).&amp;nbsp; I was surprised that it allowed the values to be separated by blank space instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So part of the confusion is that it is seeing&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;515.123&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as one value to insert and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;.4567&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as the next value in the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table class like sashelp.class(keep=name age weight);
insert into class values ('X' 123.456.789);
select * from class;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Name           Age    Weight

X          123.456     0.789

&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 05:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596746#M76209</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-16T05:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596760#M76210</link>
      <description>&lt;P&gt;Hasn't this already been dealt with in&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/insert-values-in-proc-sql/m-p/596038" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Procedures/insert-values-in-proc-sql/m-p/596038&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 06:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596760#M76210</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-16T06:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596763#M76211</link>
      <description>&lt;P&gt;And my advice from your previous post stands: use the much simpler data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data employeesdata;
input
  employee_id :$3.
  first_name :$15.
  last_name :&amp;amp;$18.
  email :$18.
  phone_number :$20.
  hire_date :yymmdd10.
  job_id :$12.
  salary
  commission_pct
  manager_id :$3.
  department_id :$3.
;
format
  hire_date yymmddd10.
  salary 12.2
  commission_pct 7.2
;
datalines;
100  Steven  King  SKING 515.123.4567 2003-06-17 ADPRES 24000.00 0.00 0 90 
101  Neena  Kochhar  NKOCHHAR 515.123.4568 2005-09-21 ADVP 17000.00 0.00 100 90 
102  Lex  De Haan  LDEHAAN 515.123.4569 2001-01-13 ADVP 17000.00 0.00 100 90 
103  Alexander  Hunold  AHUNOLD 590.423.4567 2006-01-03 ITPROG 9000.00 0.00 102 60 
104  Bruce  Ernst  BERNST 590.423.4568 2007-05-21 ITPROG 6000.00 0.00 103 60 
105  David  Austin  DAUSTIN 590.423.4569 2005-06-25 ITPROG 4800.00 0.00 103 60 
106  Valli  Pataballa  VPATABAL 590.423.4560 2006-02-05 ITPROG 4800.00 0.00 103 60
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 07:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596763#M76211</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-16T07:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596764#M76212</link>
      <description>&lt;P&gt;And only store values as numbers that will/can be used for calculations. Wasting 8 numeric bytes for a three-character ID is nonsense.&lt;/P&gt;
&lt;P&gt;And if you have longer ID's, numeric will sooner or later have precision issues, and it can't deal correctly with leading zeroes.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 07:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596764#M76212</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-16T07:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596766#M76213</link>
      <description>&lt;P&gt;Hi sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want proc sql&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 07:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596766#M76213</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-10-16T07:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: salary float datatype in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596767#M76214</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi sir,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want proc sql&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maxim 14.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 07:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/salary-float-datatype-in-proc-sql/m-p/596767#M76214</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-16T07:30:31Z</dc:date>
    </item>
  </channel>
</rss>

