<?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 change the value of automatic macro variable and understanding of error code 1012? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637180#M189414</link>
    <description>&lt;P&gt;call symput() expects character arguments; since your data step does not define &lt;EM&gt;data step variable&lt;/EM&gt; syscc, it is automatically created as numeric with a missing value, and that does not work.&lt;/P&gt;
&lt;P&gt;You need this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let syscc=1012;
data _null_;
if &amp;amp;syscc. = 1012 then call symput("syscc","0");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you have a character literal instead of a variable name.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Apr 2020 08:59:46 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-04-03T08:59:46Z</dc:date>
    <item>
      <title>How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637174#M189410</link>
      <description>&lt;P&gt;I would like to how to change the value of automatic macro variable &amp;amp;syscc. I tried the code below, but it's not working. Any help?&amp;nbsp; Also I want to know some examples where we get this error in real life. I knew that error code 1012 means 'General error condition' what does mean is my question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; syscc=1012;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;syscc.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1012&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symput(syscc,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Error:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
      29:36   29:42   
ERROR: Symbolic variable name            . must begin with a letter or underscore.
NOTE: Invalid argument to function SYMPUT('           .','           0') at line 29 column 29.
SYSCC=. _ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 08:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637174#M189410</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T08:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637180#M189414</link>
      <description>&lt;P&gt;call symput() expects character arguments; since your data step does not define &lt;EM&gt;data step variable&lt;/EM&gt; syscc, it is automatically created as numeric with a missing value, and that does not work.&lt;/P&gt;
&lt;P&gt;You need this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let syscc=1012;
data _null_;
if &amp;amp;syscc. = 1012 then call symput("syscc","0");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you have a character literal instead of a variable name.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 08:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637180#M189414</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T08:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637181#M189415</link>
      <description>&lt;P&gt;As an alternative, consider this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;syscc = 1012 %then %do;
  %let syscc = 0;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which can be used in open code (outside a macro) since at least 9.4M5.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 09:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637181#M189415</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T09:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637183#M189416</link>
      <description>On what scenarios we will see &amp;amp;syscc resolves to 1012?&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2020 09:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637183#M189416</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T09:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637188#M189417</link>
      <description>&lt;P&gt;You can find a list of SAS error codes in the documentation for the &lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1wrevo4roqsnxn1fbd9yezxvv9k.htm&amp;amp;docsetVersion=3.2&amp;amp;locale=en" target="_blank" rel="noopener"&gt;SYSERR Automatic Macro Variable&lt;/A&gt;. In short, 1012 is a very often appearing code.&lt;/P&gt;
&lt;P&gt;In my programs, I only check for &amp;amp;syscc ne 0, as my codes are written in a way that they stay absolutely clean on a successful run. No ERRORs, no WARNINGs.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 10:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637188#M189417</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T10:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637191#M189418</link>
      <description>OK, but in my program I don't know where it is getting resolved to 1012.&lt;BR /&gt;It's a very big program which includes multiple data steps and when I see&lt;BR /&gt;the value of syscc it is resolved to 1012 and there is no error in the log&lt;BR /&gt;except the warning.&lt;BR /&gt;&lt;BR /&gt;I have used syscc only at the end of the program, so I'm not certain where&lt;BR /&gt;it is getting to resolved to 1012.&lt;BR /&gt;&lt;BR /&gt;It's a painful task if I was asked to write syscc at the end of each step.&lt;BR /&gt;How to identify which step has syscc that resolves to 1012?&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2020 10:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637191#M189418</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637199#M189421</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote in part:&lt;BR /&gt;&lt;BR /&gt;It's a painful task if I was asked to write syscc at the end of each step.&lt;BR /&gt;How to identify which step has syscc that resolves to 1012?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggest searching the log for errors, warnings, or bad notes.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 10:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637199#M189421</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-04-03T10:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637202#M189422</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It's a painful task if I was asked to write syscc at the end of each step.&lt;BR /&gt;How to identify which step has syscc that resolves to 1012?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't need to write it at the end of each step if you use the &lt;EM&gt;bisection method&lt;/EM&gt;: If your program consists of, say, up to 256 (in general: 2**n) steps and global statements, it will suffice to retrieve the value of SYSCC up to 8 (in general: n) times. First, &lt;FONT face="courier new,courier"&gt;%put &amp;amp;syscc;&lt;/FONT&gt; would be placed after the first half of the steps/global statements, then moved after the first or third quarter depending on whether the first SYSCC value was 1012 or 0, and so on. After each check only about half of the remaining steps/global statements need to be investigated further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you've identified the step or statement which causes &amp;amp;SYSCC=1012 &lt;EM&gt;without an error message&lt;/EM&gt;, please post it here.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 10:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637202#M189422</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-03T10:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637210#M189424</link>
      <description>&lt;P&gt;How did you scan for the words ERROR and WARNING?&lt;/P&gt;
&lt;P&gt;Check for syscc ne 0 right at the start of your program, it might be that you "inherit" the SYSCC code from the autoexec. If that is the case, have the SAS administrator fix it, or do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let syscc = 0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as the very first statement in your code.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 11:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637210#M189424</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T11:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637212#M189425</link>
      <description>Could you please tell me how to check for syscc ne 0 at the start of the&lt;BR /&gt;program?&lt;BR /&gt;&lt;BR /&gt;My program already had syscc=0 as a first line.&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2020 11:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637212#M189425</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637213#M189426</link>
      <description>There is no error in the log and of course there are few warnings which is&lt;BR /&gt;OK for me. So those warnings might have contributed to syscc to resolve&lt;BR /&gt;1012?&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2020 11:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637213#M189426</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T11:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637214#M189427</link>
      <description>I don't want to count the number of steps in my program as I'm sure there&lt;BR /&gt;are more than 256.So can I randomly place syscc for every few steps?&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637214#M189427</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-03T12:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637222#M189430</link>
      <description>&lt;P&gt;No program that deserves to be called a program throws a WARNING. NOT A SINGLE ONE.&lt;/P&gt;
&lt;P&gt;Unless something untoward happens, then the developer checks for the reason and either provides a fix in the program or sends the damaged input data back to the source, with a request to correct it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See Maxims 24 and 25.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Return codes not zero have to be used to detect unwanted, abnormal situations, aside from that they must NOT be tolerated. How could you reliably detect a successful run otherwise?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637222#M189430</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T12:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637285#M189442</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I don't want to count the number of steps in my program as I'm sure there&lt;BR /&gt;are more than 256.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It's not necessary to determine exact numbers of steps or global statements as long as you keep track of the previous location of the &lt;FONT face="courier new,courier"&gt;%put &amp;amp;=syscc;&lt;/FONT&gt; statement whenever you move it to a new position. You can also use the line numbers of your program instead of step numbers to find a reasonable location for the statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;So can I randomly place syscc for every few steps?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Even a single&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%put &amp;amp;=syscc;&lt;/FONT&gt; statement per run would be sufficient. The trick is to move it systematically depending on the previous result so that the amount of code potentially containing the faulty line is (approximately) cut in half in every recursion of the process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, you can start with submitting only the upper half of the program. If &amp;amp;SYSCC is still 0 at this point (i.e., the upper half is error-free as far as SYSCC is concerned), continue with the third quarter of the program (i.e., the "upper half of the bottom half"). Otherwise you know that the culprit must be somewhere in the upper half and you can restrict the next run to the first quarter of the program. Either way, after the second (partial) run you know the &lt;EM&gt;quarter&lt;/EM&gt; of the program where &amp;amp;SYSCC becomes 1012 first. Similarly,&amp;nbsp;after the third (partial) run you know the &lt;EM&gt;eighth&lt;/EM&gt;&amp;nbsp;of the program where this happens, and so on.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637285#M189442</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-03T14:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the value of automatic macro variable and understanding of error code 1012?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637364#M189460</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I suggest that you add a line of code&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;options dsoptions=note2err;&lt;BR /&gt;&lt;BR /&gt;at the beginning of your long program. That will better highlight problems that you may have overlooked.&amp;nbsp; Then fix your code so that these new errors are avoided.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 21:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-value-of-automatic-macro-variable-and/m-p/637364#M189460</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-04-03T21:51:33Z</dc:date>
    </item>
  </channel>
</rss>

