<?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: Please check how to correct the error message for this query m105p01.sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961961#M374984</link>
    <description>Maybe OP has an old version sas.&lt;BR /&gt;When I do the same thing with very old sas, I am really running into the same problem.</description>
    <pubDate>Sun, 16 Mar 2025 01:04:09 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-03-16T01:04:09Z</dc:date>
    <item>
      <title>Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961817#M374938</link>
      <description>&lt;P&gt;&lt;STRONG&gt;m105p01.sas&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%Macro GroupList(Tab, Col);&lt;BR /&gt;title "Group: &amp;amp;&amp;amp;Val&amp;amp;i";&lt;BR /&gt;Proc SQL noprint;&lt;BR /&gt;Select Distinct Upcase(&amp;amp;Col)&lt;BR /&gt;into :Val1-&lt;BR /&gt;From&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;Data&lt;BR /&gt;%do i=1 %to &amp;amp;sqlobs;&lt;BR /&gt;Title "Group: &amp;amp;&amp;amp;Val&amp;amp;i ";&lt;BR /&gt;&lt;BR /&gt;proc print data=&amp;amp;Tab (obs=10);&lt;BR /&gt;where upcase(&amp;amp;Col)="&amp;amp;&amp;amp;Val&amp;amp;i";&lt;BR /&gt;%end;&lt;BR /&gt;run;&lt;BR /&gt;%mend GroupList;&lt;BR /&gt;Options Mprint MLogic;&lt;/P&gt;&lt;P&gt;%GroupList(sashelp.cars, DriveTrain)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hmlong25_0-1741900525112.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105405i0992D10383829478/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hmlong25_0-1741900525112.png" alt="hmlong25_0-1741900525112.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hmlong25_1-1741900600389.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105406i9E93407BDAA795C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hmlong25_1-1741900600389.png" alt="hmlong25_1-1741900600389.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 21:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961817#M374938</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-03-13T21:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961829#M374940</link>
      <description>&lt;P&gt;You need to start with working SAS code before trying to use a macro to generate SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your posted code is not valid.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Group: &amp;amp;&amp;amp;Val&amp;amp;i";
Proc SQL noprint;
Select Distinct Upcase(&amp;amp;Col)
into :Val1-
From
quit;

Data&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run it without the macro wrapper to get a better set of error messages.&lt;/P&gt;
&lt;PRE&gt;WARNING: Apparent symbolic reference I not resolved.
1    title "Group: &amp;amp;&amp;amp;Val&amp;amp;i";
WARNING: Apparent symbolic reference VAL not resolved.
WARNING: Apparent symbolic reference I not resolved.
2    Proc SQL noprint;
3    Select Distinct Upcase(DriveTrain)
4    into :Val1-
5    From
6    quit;
ERROR: File WORK.QUIT.DATA does not exist.
7
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



8    Data
9
10   proc print data=sashelp.cars(obs=10);
                    -
                    22
                    76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.

ERROR 76-322: Syntax error, statement will be ignored.

11   run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Mar 2025 23:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961829#M374940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-13T23:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961832#M374943</link>
      <description>Get rid of NOPRINT option with PROC SQL. &lt;BR /&gt;System macro variable &amp;amp;sqlobs. will always get 0 if you specify NOPRINT.&lt;BR /&gt;&lt;BR /&gt;Proc SQL noprint;&lt;BR /&gt;----&amp;gt;&lt;BR /&gt;Proc SQL ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And if you do not want print these value. Try to create a NULL dataset:&lt;BR /&gt;&lt;BR /&gt;Proc SQL ;&lt;BR /&gt;create table _null_ as&lt;BR /&gt;Select Distinct Upcase(&amp;amp;Col)&lt;BR /&gt;into :Val1-&lt;BR /&gt;From&lt;BR /&gt;quit;</description>
      <pubDate>Fri, 14 Mar 2025 01:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961832#M374943</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-14T01:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961933#M374970</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;Your answer is completely wrong here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SQLOBS macro variable will be set properly when NOPRINT option is used.&amp;nbsp; Here is a simple example:&lt;/P&gt;
&lt;PRE&gt;1    proc sql noprint;
2    select name into :males separated by ' ' from sashelp.class where sex='F';
3    %put &amp;amp;=sqlobs;
SQLOBS=9
4    select name into :unknown separated by ' ' from sashelp.class where sex not in ('M' 'F');
NOTE: No rows were selected.
5    %put &amp;amp;=sqlobs;
SQLOBS=0
6    quit;
&lt;/PRE&gt;
&lt;P&gt;The problem with the code is it is not actually querying from any table, so it tries to query a table named QUIT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 21:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961933#M374970</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-14T21:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961940#M374973</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;
&lt;P&gt;Here is what I got.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    proc sql noprint;
2    select name from sashelp.class;
3    quit;
NOTE: “PROCEDURE SQL”所用时间（总处理时间）:
      实际时间          0.10 秒
      CPU 时间          0.03 秒


4    %put &amp;amp;sqlobs. ;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;1


&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;1    proc sql ;
2    select name from sashelp.class;
NOTE: 正在写入 HTML Body（主体）文件: sashtml.htm
3    quit;
NOTE: “PROCEDURE SQL”所用时间（总处理时间）:
      实际时间          0.84 秒
      CPU 时间          0.28 秒


4    %put &amp;amp;sqlobs. ;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;19

&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Mar 2025 06:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961940#M374973</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-15T06:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961950#M374977</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; If you tell SQL to not produce ANY output then it doesn't actually bother to run the query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the query in question did produce output, the values put into macro variable(s).&lt;/P&gt;</description>
      <pubDate>Sat, 15 Mar 2025 16:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961950#M374977</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-15T16:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Please check how to correct the error message for this query m105p01.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961961#M374984</link>
      <description>Maybe OP has an old version sas.&lt;BR /&gt;When I do the same thing with very old sas, I am really running into the same problem.</description>
      <pubDate>Sun, 16 Mar 2025 01:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-how-to-correct-the-error-message-for-this-query/m-p/961961#M374984</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-16T01:04:09Z</dc:date>
    </item>
  </channel>
</rss>

