<?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: can't figure out what that error is in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14031#M1762</link>
    <description>You would benefit from running your code again with:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MGEN SGEN MLOGIC MPRINT;&lt;BR /&gt;
&lt;BR /&gt;
Also, you didn't share the code that came just before the error -- my bet is you made some type of direct/indirect change to a SAS program and there is an open comment or some other syntax condition also that is occurring *BEFORE* this error.&lt;BR /&gt;
&lt;BR /&gt;
Suggest some desk-checking before public forum rant keeps sanity in order.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc</description>
    <pubDate>Mon, 09 Nov 2009 19:11:49 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-11-09T19:11:49Z</dc:date>
    <item>
      <title>can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14030#M1761</link>
      <description>In the first line of the following coding, what the hell is wrong with error 180-322?&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%else &lt;U&gt;%do; proc sql noprint; select count(distinct put(status,8.0)) into :status_count from project.&amp;amp;current_node; &lt;/U&gt;**************Check the singularity of status values for all partition datasets*****************;&lt;BR /&gt;
                   %if %trim(%left(&amp;amp;status_count)) =1 %then %do; &lt;BR /&gt;
                    select distinct trim(left(put(status,8.0))) into :class_label from project.&amp;amp;current_node; quit;                    &lt;BR /&gt;
                    %put STATUS=&amp;amp;CLASS_LABEL;&lt;BR /&gt;
                    %let index_none_tuple=%index(&amp;amp;update_node_list,&amp;amp;current_node);*********remove single class node from node list**********;&lt;BR /&gt;
                    %let length_none_tuple=%length(&amp;amp;current_node);&lt;BR /&gt;
                    %let update_node_list=%substr(&amp;amp;update_node_list, 1, %eval(&amp;amp;index_none_tuple-1))%substr(&amp;amp;update_node_list, %eval(&amp;amp;index_none_tuple+&amp;amp;length_none_tuple+1));&lt;BR /&gt;
&lt;BR /&gt;
                    %end;&lt;BR /&gt;
                    %else quit;&lt;BR /&gt;
	 &lt;BR /&gt;
            %end;</description>
      <pubDate>Mon, 09 Nov 2009 19:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14030#M1761</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-09T19:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14031#M1762</link>
      <description>You would benefit from running your code again with:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MGEN SGEN MLOGIC MPRINT;&lt;BR /&gt;
&lt;BR /&gt;
Also, you didn't share the code that came just before the error -- my bet is you made some type of direct/indirect change to a SAS program and there is an open comment or some other syntax condition also that is occurring *BEFORE* this error.&lt;BR /&gt;
&lt;BR /&gt;
Suggest some desk-checking before public forum rant keeps sanity in order.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc</description>
      <pubDate>Mon, 09 Nov 2009 19:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14031#M1762</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-09T19:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14032#M1763</link>
      <description>My guess is that it doesn't like the semicolons in your proc statement.  Try using the quoting functions.</description>
      <pubDate>Tue, 01 Dec 2009 14:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14032#M1763</guid>
      <dc:creator>PatrickG</dc:creator>
      <dc:date>2009-12-01T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14033#M1764</link>
      <description>seems that your code is from a macro. if so, any comment MUST be started with a %, e.g.&lt;BR /&gt;
&lt;BR /&gt;
%******Check the singularity of status values for all partition datasets********;&lt;BR /&gt;
&lt;BR /&gt;
very likely this is what your SAS is complaining about.</description>
      <pubDate>Tue, 01 Dec 2009 20:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14033#M1764</guid>
      <dc:creator>abdullala</dc:creator>
      <dc:date>2009-12-01T20:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14034#M1765</link>
      <description>It's a bit late to the party guys - also, I have to disagree about the comment syntax - consider:&lt;BR /&gt;
&lt;BR /&gt;
%macro x;&lt;BR /&gt;
* I am a legitimate SAS comment. ;&lt;BR /&gt;
%put Hello to the Digital Fjord. ;&lt;BR /&gt;
%mend x;&lt;BR /&gt;
%x;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 01 Dec 2009 20:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14034#M1765</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-01T20:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14035#M1766</link>
      <description>well, i believe that although it may seem to have no harm in this simple code, it will bomb sooner or later ... it is always safe to precede the comment with a %, my hard-learned lesson!</description>
      <pubDate>Tue, 01 Dec 2009 21:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14035#M1766</guid>
      <dc:creator>abdullala</dc:creator>
      <dc:date>2009-12-01T21:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14036#M1767</link>
      <description>may have problem with statement of&lt;BR /&gt;
put(status,8.0) &lt;BR /&gt;
&lt;BR /&gt;
try  put(status,8.)&lt;BR /&gt;
&lt;BR /&gt;
you need one more semicolon after the quit&lt;BR /&gt;
&lt;BR /&gt;
%else quit;;</description>
      <pubDate>Tue, 01 Dec 2009 21:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14036#M1767</guid>
      <dc:creator>SUN59338</dc:creator>
      <dc:date>2009-12-01T21:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14037#M1768</link>
      <description>What has been revealed by the OP is an incomplete macro - we need to see the entire process, preferably as SAS is compiling and executing, if you really want to get a reasonable and credible response, without wasting others' time.&lt;BR /&gt;
&lt;BR /&gt;
So, suggest you execute your SAS application program with the maximum SAS log diagnostics activated, including MACROGEN SYMBOLGEN and MLOGIC, then after reviewing the execution output yourself for desk-checking purpose/value, then re-post a reply to the forum and provide (COPY and PASTE) the SAS-generated SAS log output -- preferably all of it.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 02 Dec 2009 00:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14037#M1768</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-02T00:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: can't figure out what that error is</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14038#M1769</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Scott...there is not enough information. For one thing, I'd like to see the WORKING SAS program that you started with. If, for example, we strip out ALL the macro code, we are reduced to this:&lt;BR /&gt;
                 &lt;BR /&gt;
[pre]&lt;BR /&gt;
   proc sql noprint; &lt;BR /&gt;
     select count(distinct put(status,8.0)) into :status_count from project.&amp;amp;current_node; &lt;BR /&gt;
                      &lt;BR /&gt;
** when some condition is met;&lt;BR /&gt;
     select distinct trim(left(put(status,8.0))) into :class_label from project.&amp;amp;current_node; quit; &lt;BR /&gt;
     ** issue a bunch of %LET statements;&lt;BR /&gt;
** end of second select distinct;&lt;BR /&gt;
 quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
Do you expect to get a count in &amp;amp;status_count???? Is there only 1 status??? Did you want a list of all the distinct status values in one macro var or in multiple macro vars??&lt;BR /&gt;
 &lt;BR /&gt;
Consider the following example that uses 4 regions from SASHELP.SHOES:&lt;BR /&gt;
[pre]&lt;BR /&gt;
** make a file with 4 regions;&lt;BR /&gt;
proc sort data=sashelp.shoes out=shoes;&lt;BR /&gt;
  where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
  by region;&lt;BR /&gt;
run;&lt;BR /&gt;
                                                                 &lt;BR /&gt;
** these are some different ways that I could write WORKING code; &lt;BR /&gt;
proc sql; &lt;BR /&gt;
     select count(distinct region) into :cnt from shoes; &lt;BR /&gt;
	 %let cnt = &amp;amp;cnt; /* strip leading and trailing blanks from CNT macro var */&lt;BR /&gt;
	 %put number of regions in cnt is &amp;amp;cnt;&lt;BR /&gt;
                                         &lt;BR /&gt;
     select distinct region into :reg from shoes; &lt;BR /&gt;
	 %put There are 4 regions in the file, but I will only get: &amp;amp;reg;&lt;BR /&gt;
&lt;BR /&gt;
                                   &lt;BR /&gt;
     select distinct region into :reglist separated by '~' from shoes ; &lt;BR /&gt;
	 %put There are 4 regions and I get: &amp;amp;reglist;&lt;BR /&gt;
                                                   &lt;BR /&gt;
     select distinct region into :reg1-:reg&amp;amp;cnt from shoes; &lt;BR /&gt;
	 %put Now I have numbered macro vars: reg1=&amp;amp;reg1 reg2=&amp;amp;reg2 reg3=&amp;amp;reg3 reg4=&amp;amp;reg4;&lt;BR /&gt;
                                  &lt;BR /&gt;
 quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                             &lt;BR /&gt;
generates these results in the SAS log:&lt;BR /&gt;
[pre]&lt;BR /&gt;
160  ** make a file with 4 regions;&lt;BR /&gt;
161  proc sort data=sashelp.shoes out=shoes;&lt;BR /&gt;
162    where region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
163    by region;&lt;BR /&gt;
164  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 158 observations read from the data set SASHELP.SHOES.&lt;BR /&gt;
      WHERE region in ('Asia', 'Canada', 'Pacific', 'Western Europe');&lt;BR /&gt;
NOTE: The data set WORK.SHOES has 158 observations and 7 variables.&lt;BR /&gt;
NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
                                     &lt;BR /&gt;
165&lt;BR /&gt;
166  ** these are some different ways that I could write WORKING code;&lt;BR /&gt;
167  proc sql;&lt;BR /&gt;
168       select count(distinct region) into :cnt from shoes;&lt;BR /&gt;
169       %let cnt = &amp;amp;cnt; /* strip leading and trailing blanks from CNT macro var */&lt;BR /&gt;
170       %put number of regions in cnt is &amp;amp;cnt;&lt;BR /&gt;
number of regions in cnt is 4&lt;BR /&gt;
171&lt;BR /&gt;
172       select distinct region into :reg from shoes;&lt;BR /&gt;
173       %put There are 4 regions in the file, but I will only get: &amp;amp;reg;&lt;BR /&gt;
There are 4 regions in the file, but I will only get: Asia&lt;BR /&gt;
174&lt;BR /&gt;
175&lt;BR /&gt;
176       select distinct region into :reglist separated by '~' from shoes ;&lt;BR /&gt;
177       %put There are 4 regions and I get: &amp;amp;reglist;&lt;BR /&gt;
There are 4 regions and I get: Asia~Canada~Pacific~Western Europe&lt;BR /&gt;
178&lt;BR /&gt;
179       select distinct region into :reg1-:reg&amp;amp;cnt from shoes;&lt;BR /&gt;
180       %put Now I have numbered macro vars: reg1=&amp;amp;reg1 reg2=&amp;amp;reg2 reg3=&amp;amp;reg3 reg4=&amp;amp;reg4;&lt;BR /&gt;
Now I have numbered macro vars: reg1=Asia reg2=Canada reg3=Pacific reg4=Western Europe&lt;BR /&gt;
181&lt;BR /&gt;
182   quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
                                             &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                      &lt;BR /&gt;
What is your WORKING code that you started with? What does your data look like (or a subset of your data)? What do you expect to see and then what is the resolved code that you expect your macro program to generate??&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 02 Dec 2009 03:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-figure-out-what-that-error-is/m-p/14038#M1769</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-12-02T03:09:14Z</dc:date>
    </item>
  </channel>
</rss>

