<?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 How to adjust the code to test the automatic variable _ERROR_ ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-the-code-to-test-the-automatic-variable-ERROR/m-p/730866#M227645</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just learnt from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; a good tool regarding &lt;STRONG&gt;put_all_;&lt;/STRONG&gt; to see what seemingly works behind the scene.&lt;/P&gt;
&lt;P&gt;So, in the compilation step, after the input buffer is the PDV step. In this step, SAS will create two automatic variables named _N_ and _ERROR_&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ResoluteCarbon_0-1617314143490.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56825i96ACA19305BF1020/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ResoluteCarbon_0-1617314143490.png" alt="ResoluteCarbon_0-1617314143490.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how to adjust the code below to see &lt;STRONG&gt;_error_&lt;/STRONG&gt; different from 0.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data storm_complete;
	set pg2.storm_summary_small;
	length Ocean $ 8;
	where Name is not missing;
	Basin=upcase(Basin);
	StormLength=EndDate-StartDate;

	if substr(Basin,2,1)="I" then
		Ocean="Indian";
	else if substr(Basin,2,1)="A" then
		Ocean="Atlantic";
	else Ocean="Pacific";
	drop EndDate;
	put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Name=AGATHA Basin=EP MaxWind=115 StartDate=09JUN1980 EndDate=15JUN1980 StormLength=6
Ocean=Pacifi &lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=1
Name=ALBINE Basin=SI MaxWind=. StartDate=27NOV1979 EndDate=06DEC1979 StormLength=9 Ocean=Indian
&lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=2
Name=ALEX Basin=WP MaxWind=40 StartDate=09OCT1980 EndDate=14OCT1980 StormLength=5 Ocean=Pacifi
&lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=3&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tried to delete some semicolon but the code just stop working rather than announce the _error_ different from 0.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 21:55:58 GMT</pubDate>
    <dc:creator>ResoluteCarbon</dc:creator>
    <dc:date>2021-04-01T21:55:58Z</dc:date>
    <item>
      <title>How to adjust the code to test the automatic variable _ERROR_ ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-the-code-to-test-the-automatic-variable-ERROR/m-p/730866#M227645</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just learnt from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; a good tool regarding &lt;STRONG&gt;put_all_;&lt;/STRONG&gt; to see what seemingly works behind the scene.&lt;/P&gt;
&lt;P&gt;So, in the compilation step, after the input buffer is the PDV step. In this step, SAS will create two automatic variables named _N_ and _ERROR_&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ResoluteCarbon_0-1617314143490.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56825i96ACA19305BF1020/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ResoluteCarbon_0-1617314143490.png" alt="ResoluteCarbon_0-1617314143490.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how to adjust the code below to see &lt;STRONG&gt;_error_&lt;/STRONG&gt; different from 0.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data storm_complete;
	set pg2.storm_summary_small;
	length Ocean $ 8;
	where Name is not missing;
	Basin=upcase(Basin);
	StormLength=EndDate-StartDate;

	if substr(Basin,2,1)="I" then
		Ocean="Indian";
	else if substr(Basin,2,1)="A" then
		Ocean="Atlantic";
	else Ocean="Pacific";
	drop EndDate;
	put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Name=AGATHA Basin=EP MaxWind=115 StartDate=09JUN1980 EndDate=15JUN1980 StormLength=6
Ocean=Pacifi &lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=1
Name=ALBINE Basin=SI MaxWind=. StartDate=27NOV1979 EndDate=06DEC1979 StormLength=9 Ocean=Indian
&lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=2
Name=ALEX Basin=WP MaxWind=40 StartDate=09OCT1980 EndDate=14OCT1980 StormLength=5 Ocean=Pacifi
&lt;STRONG&gt;_ERROR_=0&lt;/STRONG&gt; _N_=3&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tried to delete some semicolon but the code just stop working rather than announce the _error_ different from 0.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 21:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-the-code-to-test-the-automatic-variable-ERROR/m-p/730866#M227645</guid>
      <dc:creator>ResoluteCarbon</dc:creator>
      <dc:date>2021-04-01T21:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust the code to test the automatic variable _ERROR_ ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-the-code-to-test-the-automatic-variable-ERROR/m-p/730869#M227646</link>
      <description>&lt;P&gt;Try dividing by zero, log of a negative number, subscript out of bounds, or any other error condition.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 21:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-the-code-to-test-the-automatic-variable-ERROR/m-p/730869#M227646</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2021-04-01T21:58:47Z</dc:date>
    </item>
  </channel>
</rss>

