<?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 Assignment Statement; Error creation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assignment-Statement-Error-creation/m-p/687146#M208584</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; We generally create new variables using assignment statement. When the specified variable is not present in the data step we get an uniniitalized note in the SAS log. But the requirement is to generate an ERROR in the log if the specified variable is not present while creating new variable using assignment statement. Any ideas on this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set sashelp.class;
 new=gender;
run ;

NOTE: Variable gender is uninitialized.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.WANT has 19 observations and 7 variables.
NOTE: Compressing data set WORK.WANT increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:06:11 GMT</pubDate>
    <dc:creator>keen_sas</dc:creator>
    <dc:date>2020-09-28T09:06:11Z</dc:date>
    <item>
      <title>Assignment Statement; Error creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignment-Statement-Error-creation/m-p/687146#M208584</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; We generally create new variables using assignment statement. When the specified variable is not present in the data step we get an uniniitalized note in the SAS log. But the requirement is to generate an ERROR in the log if the specified variable is not present while creating new variable using assignment statement. Any ideas on this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set sashelp.class;
 new=gender;
run ;

NOTE: Variable gender is uninitialized.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.WANT has 19 observations and 7 variables.
NOTE: Compressing data set WORK.WANT increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignment-Statement-Error-creation/m-p/687146#M208584</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2020-09-28T09:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Assignment Statement; Error creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignment-Statement-Error-creation/m-p/687149#M208586</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16518"&gt;@keen_sas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried the &lt;A href="https://documentation.sas.com/?docsetId=lesysoptsref&amp;amp;docsetTarget=n039l39682ccgen1xswd1fsfaqk9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;VARINITCHK system option&lt;/A&gt;?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options varinitchk=error;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your DATA step would then result in:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;ERROR: Variable gender is uninitialized.&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;
&lt;FONT color="#008000"&gt;WARNING: The data set WORK.WANT may be incomplete.  When this step was stopped there were 0 observations and 7 variables.&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt;NOTE: DATA statement used (Total process time):
...&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignment-Statement-Error-creation/m-p/687149#M208586</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-28T09:26:51Z</dc:date>
    </item>
  </channel>
</rss>

