<?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: Error Message ERROR 180-322 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913905#M360166</link>
    <description>&lt;P&gt;The macro variables TERM2 and TERM3 have the wrong types of values for how you are trying to use them.&amp;nbsp; You are using them as variable names, but the strings you have in them are just digit strings, so to SAS code they look like numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show where they are getting there values from, but you should change them to :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let term3 = "202208"n;
%let term2 = "202301"n;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Feb 2024 00:10:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-02-01T00:10:47Z</dc:date>
    <item>
      <title>Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913894#M360158</link>
      <description>&lt;P&gt;the data set name is two_clean.&lt;/P&gt;&lt;P&gt;I have column names like&amp;nbsp; 201808&amp;nbsp; 201901&amp;nbsp; 201908&amp;nbsp; 202001&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;column Name 201808&amp;nbsp; &amp;nbsp; &amp;nbsp; 201901&amp;nbsp; 201908&amp;nbsp; &amp;nbsp; 202001&lt;BR /&gt;Row 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_1_5_4_P _1_5_4_P&amp;nbsp; _1_5_4_P&amp;nbsp; _1_5_4_P&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt; pairs(pair1, pair2, pair3, pair4);&lt;/P&gt;&lt;P&gt;DATA year&amp;amp;pair1;&lt;/P&gt;&lt;P&gt;SET two_clean;&lt;/P&gt;&lt;P&gt;WHERE %&lt;STRONG&gt;&lt;EM&gt;tslit&lt;/EM&gt;&lt;/STRONG&gt;(&amp;amp;pair2) NE '';&lt;/P&gt;&lt;P&gt;IF &amp;amp;pair2 NE '' AND &amp;amp;pair3='' THEN &amp;amp;pair3="Did not return";&lt;/P&gt;&lt;P&gt;KEEP ID &amp;amp;pair2 &amp;amp;pair3;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt; pairs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;EM&gt;pairs&lt;/EM&gt;&lt;/STRONG&gt;(&lt;STRONG&gt;1&lt;/STRONG&gt;,&amp;amp;term3,&amp;amp;term2,&amp;amp;term3);&lt;/P&gt;&lt;P&gt;Error Message:-&amp;nbsp;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable PAIR2 resolves to 202208&lt;BR /&gt;SYMBOLGEN: Macro variable PAIR3 resolves to 202301&lt;BR /&gt;SYMBOLGEN: Macro variable PAIR3 resolves to 202301&lt;BR /&gt;NOTE: Line generated by the macro variable "PAIR3".&lt;BR /&gt;53 202301&lt;BR /&gt;______&lt;BR /&gt;180&lt;BR /&gt;MPRINT(PAIRS): IF 202208 NE '' AND 202301='' THEN 202301="Did not return";&lt;BR /&gt;SYMBOLGEN: Macro variable PAIR2 resolves to 202208&lt;BR /&gt;SYMBOLGEN: Macro variable PAIR3 resolves to 202301&lt;BR /&gt;NOTE 138-205: Line generated by the macro variable "PAIR2".&lt;BR /&gt;53 202208&lt;BR /&gt;______&lt;BR /&gt;22&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, -, :, ;, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "PAIR2".&lt;BR /&gt;53 202208&lt;BR /&gt;______&lt;BR /&gt;200&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;MPRINT(PAIRS): KEEP ID 202208 202301;&lt;BR /&gt;MPRINT(PAIRS): RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Akhila1_0-1706742767564.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93136i2D8B2C3741B6279C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Akhila1_0-1706742767564.png" alt="Akhila1_0-1706742767564.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 23:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913894#M360158</guid>
      <dc:creator>Akhila1</dc:creator>
      <dc:date>2024-01-31T23:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913897#M360160</link>
      <description>&lt;P&gt;How did you get a variable name like 202208?&amp;nbsp; That's not a usual name in SAS.&amp;nbsp; Perhaps you could run a PROC CONTENTS on your data set and confirm what is in there.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 23:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913897#M360160</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-01-31T23:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913901#M360162</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Akhila1_0-1706742820861.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93137i14170B961A30050E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Akhila1_0-1706742820861.png" alt="Akhila1_0-1706742820861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 23:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913901#M360162</guid>
      <dc:creator>Akhila1</dc:creator>
      <dc:date>2024-01-31T23:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913902#M360163</link>
      <description>&lt;P&gt;If you insist on using non-standard SAS column names then to refer to them in code you have to enclose them in quotes, immediately followed by the letter "n":&lt;/P&gt;
&lt;P&gt;'202308'n or if it is resolving a macro variable "&amp;amp;MyVar"n. Personally I find the cure worse than the disease so I never use non-standard names.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 23:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913902#M360163</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-31T23:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913905#M360166</link>
      <description>&lt;P&gt;The macro variables TERM2 and TERM3 have the wrong types of values for how you are trying to use them.&amp;nbsp; You are using them as variable names, but the strings you have in them are just digit strings, so to SAS code they look like numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show where they are getting there values from, but you should change them to :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let term3 = "202208"n;
%let term2 = "202301"n;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Feb 2024 00:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913905#M360166</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-01T00:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message ERROR 180-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913989#M360177</link>
      <description>&lt;P&gt;You have two issues here:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;usage of VALIDVARNAME=ANY, combined with the use of PROC IMPORT; this leads to non-standard names&lt;/LI&gt;
&lt;LI&gt;hiding data (dates) in structure (variable names)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=two_clean out=long1 (rename=(col1=value));
by /* use variable(s) which identify each row/observation, sort first if necessary */;
var '201808'n--'202308'n;
run;

data long;
set long1;
month = input(_name_,yymmn6.);
format month yymmn6.;
drop _name_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can now use all date-related functions/tools on the&amp;nbsp;&lt;EM&gt;data&lt;/EM&gt; to help with your&amp;nbsp; analysis.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 10:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Message-ERROR-180-322/m-p/913989#M360177</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-01T10:54:40Z</dc:date>
    </item>
  </channel>
</rss>

