<?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: How to fix this error if numberic missing values in given table in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686927#M33100</link>
    <description>&lt;P&gt;You need to have a value for each field, if you don't list the specific fields.&amp;nbsp; Use period to indicate a missing numeric, use ' ' to indicate an empty string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also use date literals for date values.&lt;/P&gt;
&lt;P&gt;So your variable types appear to be #,$,$,#,date,#,#,#&lt;/P&gt;
&lt;P&gt;So you could use either of these:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into basic values (68319,'KAYLING',' ',.,'18NOV1991'd,6000.00,.,1001) ;
insert into basic (emp_id,emp_name,hire_date,salary,dept_id)
  values (68319,'KAYLING','18NOV1991'd,6000.00,1001) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will be a lot easier to create data using a data step instead of trying to stuff the observations in one by one using SQL VALUES() clause. Then you could leave your date string in YMD order and just use the proper informat to convert those strings into date values. If you use delimited data then you can just leave the "null" values as empty.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data basic;
  infile cards dsd truncover;
  input emp_id emp_name :$20. job_name :$20. manage_id hire_date :yymmdd.
       salary commission dept_id
  ;
  format hire_date yymmdd10. ;
cards;
68319,KAYLING,,,1991-11-18,6000.00,,1001
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2020 14:27:25 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-09-26T14:27:25Z</dc:date>
    <item>
      <title>How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686901#M33092</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table basic (emp_id int not null ,
                    emp_name varchar(20),
																				job_name	varchar(20),
																				manage_id int not null,
																				hire_date	date	,
																				salary				int 	,
																				commission int not null,
																				dept_id				int );


insert into basic values (	68319 , 'KAYLING'  , 'PRESIDENT' ,     ,        1991-11-18,  6000.00  ,              1001	);
insert into basic values ( 66928  'BLAZE'    , 'MANAGER'    ,     68319 ,    1991-05-01,  2750.00    ,            3001	);
insert into basic values ( 67832  'CLARE'     ,'MANAGER'    ,    68319 ,    1991-06-09 , 2550.00    ,            1001	);
insert into basic values ( 65646  'JONAS'     ,'MANAGER'    ,    68319  ,   1991-04-02,  2957.00    ,            2001);
insert into basic values ( 67858  'SCARLET'   ,'ANALYST'    ,     65646   ,  1997-04-19,  3100.00    ,            2001);
insert into basic values ( 69062  'FRANK'     ,'ANALYST'    ,    65646    , 1991-12-03,  3100.00    ,            2001);
insert into basic values ( 63679  'SANDRINE'  ,'CLERK'      ,    69062     ,1990-12-18 ,  900.00    ,            2001);
insert into basic values ( 64989  'ADELYN'    ,'SALESMAN'    ,    66928     ,1991-02-20,  1700.00    ,  400.00 ,  3001);
insert into basic values ( 65271  'WADE'      ,'SALESMAN'    ,    66928     ,1991-02-22 , 1350.00    ,  600.00 ,  3001);
insert into basic values ( 66564  'MADDEN'    ,'SALESMAN'    ,    66928   ,  1991-09-28 , 1350.00    , 1500.00 ,  3001);
insert into basic values ( 68454  'TUCKER'    ,'SALESMAN'    ,    66928   ,  1991-09-08 , 1600.00    ,    0.00    3001);
insert into basic values ( 68736  'ADNRES'    ,'CLERK'       ,    67858    , 1997-05-23 , 1200.00    ,            2001);
insert into basic values ( 69000  'JULIUS'    ,'CLERK'       ,    66928    , 1991-12-03 , 1050.00    ,            3001);
insert into basic values ( 69324  'MARKER'    ,'CLERK'       ,    67832    , 1992-01-23 , 1400.00    ,            1001);


quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;76 dept_id int );&lt;BR /&gt;NOTE: Table WORK.BASIC created, with 0 rows and 8 columns.&lt;BR /&gt;77&lt;BR /&gt;78&lt;BR /&gt;79 insert into basic values ( 68319 , 'KAYLING' , 'PRESIDENT' , ,&lt;BR /&gt;79 ! 1991-11-18, 6000.00 , 1001 );&lt;BR /&gt;NOTE: 1 row was inserted into WORK.BASIC.&lt;/P&gt;&lt;P&gt;80 insert into basic values ( 66928 'BLAZE' , 'MANAGER' , 68319 ,&lt;BR /&gt;80 ! 1991-05-01, 2750.00 , 3001 );&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;81 insert into basic values ( 67832 'CLARE' ,'MANAGER' , 68319 ,&lt;BR /&gt;81 ! 1991-06-09 , 2550.00 , 1001 );&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;82 insert into basic values ( 65646 'JONAS' ,'MANAGER' , 68319 ,&lt;BR /&gt;82 ! 1991-04-02, 2957.00 , 2001);&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;83 insert into basic values ( 67858 'SCARLET' ,'ANALYST' , 65646 ,&lt;BR /&gt;83 ! 1997-04-19, 3100.00 , 2001);&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;84 insert into basic values ( 69062 'FRANK' ,'ANALYST' , 65646 ,&lt;BR /&gt;84 ! 1991-12-03, 3100.00 , 2001);&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;85 insert into basic values ( 63679 'SANDRINE' ,'CLERK' , 69062&lt;BR /&gt;85 ! ,1990-12-18 , 900.00 , 2001);&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;86 insert into basic values ( 64989 'ADELYN' ,'SALESMAN' , 66928&lt;BR /&gt;86 ! ,1991-02-20, 1700.00 , 400.00 , 3001);&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;87 insert into basic values ( 65271 'WADE' ,'SALESMAN' , 66928&lt;BR /&gt;87 ! ,1991-02-22 , 1350.00 , 600.00 , 3001);&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;88 insert into basic values ( 66564 'MADDEN' ,'SALESMAN' , 66928 ,&lt;BR /&gt;88 ! 1991-09-28 , 1350.00 , 1500.00 , 3001);&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;89 insert into basic values ( 68454 'TUCKER' ,'SALESMAN' , 66928 ,&lt;BR /&gt;89 ! 1991-09-08 , 1600.00 , 0.00 3001);&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;90 insert into basic values ( 68736 'ADNRES' ,'CLERK' , 67858 ,&lt;BR /&gt;90 ! 1997-05-23 , 1200.00 , 2001);&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;91 insert into basic values ( 69000 'JULIUS' ,'CLERK' , 66928 ,&lt;BR /&gt;91 ! 1991-12-03 , 1050.00 , 3001);&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;92 insert into basic values ( 69324 'MARKER' ,'CLERK' , 67832 ,&lt;BR /&gt;92 ! 1992-01-23 , 1400.00 , 1001);&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;93&lt;BR /&gt;94&lt;BR /&gt;95 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 1.82 seconds&lt;BR /&gt;cpu time 0.06 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 08:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686901#M33092</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-09-26T08:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686906#M33094</link>
      <description>&lt;P&gt;I have not checked the whole code, but if you inspect next two lines, you'll find that there are missing commas between the variables:&lt;/P&gt;
&lt;PRE&gt;insert into basic values ( 68319 , 'KAYLING'  , 'PRESIDENT' ,     ,        1991-11-18,  6000.00  ,              1001	);
insert into basic values ( 66928  'BLAZE'    , 'MANAGER'    ,     68319 ,    1991-05-01,  2750.00    ,            3001	);
&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 10:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686906#M33094</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-26T10:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686908#M33095</link>
      <description>I HAVE MISSING VALUES IN MANAGERR AND COMMISSION SO I USE NOT NULL&lt;BR /&gt;BUT I GOT ERROR</description>
      <pubDate>Sat, 26 Sep 2020 10:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686908#M33095</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-09-26T10:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686912#M33096</link>
      <description>Any null value should be enclosed between commas, otherwise you have to read the data with a data step and use fix positions for each variable value in the row.</description>
      <pubDate>Sat, 26 Sep 2020 12:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686912#M33096</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-26T12:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686913#M33097</link>
      <description>&lt;P&gt;So you only want to create a temporary table in WORK with those values?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 12:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686913#M33097</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-26T12:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686914#M33098</link>
      <description>the "emp_id int not null" means the EMP_ID must not be null, but other variables may be null.</description>
      <pubDate>Sat, 26 Sep 2020 12:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686914#M33098</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-26T12:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686915#M33099</link>
      <description>&lt;P&gt;The reason for the ERROR is the way you supply the date; you need to use SAS date literals:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table basic (
  emp_id int not null,
  emp_name char(20),
  job_name char(20),
  manage_id int,
  hire_date date informat=yymmdd10.,
  salary int,
  commission int,
  dept_id int
);
insert into basic values (
  68319,
  'KAYLING',
  'PRESIDENT',
  .,
  '18NOV1991'd,
  6000,
  .,
  1001
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To use any other informat for the date, you HAVE to use a DATA step; in fact, the data step code is so simple compared to the SQL that not using a DATA step is nothing but dumb:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data basic;
infile datalines dlm=',' dsd truncover;
input
  emp_id :$5.
  emp_name :$20.
  job_name :$20.
  manage_id :$5.
  hire_date :yymmdd10.
  salary
  commission
  dept_id :$4.
;
format
  hire_date yymmdd10.
  salary commission 12.2
;
datalines;
68319,KAYLING,PRESIDENT,,1991-11-18,6000.00,,1001
66928,BLAZE,MANAGER,68319,1991-05-01,2750.00,,3001
67832,CLARE,MANAGER,68319,1991-06-09,2550.00,,1001
65646,JONAS,MANAGER,68319,1991-04-02,2957.00,,2001
67858,SCARLET,ANALYST,65646,1997-04-19,3100.00,,2001
69062,FRANK,ANALYST,65646,1991-12-03,3100.00,,2001
63679,SANDRINE,CLERK,69062,1990-12-18,900.00,,2001
64989,ADELYN,SALESMAN,66928,1991-02-20,1700.00,400.00,3001
65271,WADE,SALESMAN,66928,1991-02-22,1350.00,600.00,3001
66564,MADDEN,SALESMAN,66928,1991-09-28,1350.00,1500.00,3001
68454,TUCKER,SALESMAN,66928,1991-09-08,1600.00,0.00,3001
68736,ADNRES,CLERK,67858,1997-05-23,1200.00,,2001
69000,JULIUS,CLERK,66928,1991-12-03,1050.00,,3001
69324,MARKER,CLERK,67832,1992-01-23,1400.00,,1001
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 12:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686915#M33099</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-26T12:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix this error if numberic missing values in given table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686927#M33100</link>
      <description>&lt;P&gt;You need to have a value for each field, if you don't list the specific fields.&amp;nbsp; Use period to indicate a missing numeric, use ' ' to indicate an empty string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also use date literals for date values.&lt;/P&gt;
&lt;P&gt;So your variable types appear to be #,$,$,#,date,#,#,#&lt;/P&gt;
&lt;P&gt;So you could use either of these:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into basic values (68319,'KAYLING',' ',.,'18NOV1991'd,6000.00,.,1001) ;
insert into basic (emp_id,emp_name,hire_date,salary,dept_id)
  values (68319,'KAYLING','18NOV1991'd,6000.00,1001) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will be a lot easier to create data using a data step instead of trying to stuff the observations in one by one using SQL VALUES() clause. Then you could leave your date string in YMD order and just use the proper informat to convert those strings into date values. If you use delimited data then you can just leave the "null" values as empty.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data basic;
  infile cards dsd truncover;
  input emp_id emp_name :$20. job_name :$20. manage_id hire_date :yymmdd.
       salary commission dept_id
  ;
  format hire_date yymmdd10. ;
cards;
68319,KAYLING,,,1991-11-18,6000.00,,1001
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 14:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fix-this-error-if-numberic-missing-values-in-given-table/m-p/686927#M33100</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-26T14:27:25Z</dc:date>
    </item>
  </channel>
</rss>

