<?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: ARRAY,MACRO variable. (ERROR with missing suffix ) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911164#M359298</link>
    <description>&lt;P&gt;You cannot make a variable list using syntax like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var1_y - var5_y&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The number must be at the END of the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best thing would be to change your variable names. So something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var_y1 - var_y5 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise you will need to use macro code to generate that goofy series of names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array var_y_arr [*]  
%do i=1 to &amp;amp;some_num;
  var&amp;amp;i._y 
%end;
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So that you get this SAS code generated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array var_y_arr [*] var1_y var2_y var3_y var4_y var5_y ; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 17:03:17 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-01-10T17:03:17Z</dc:date>
    <item>
      <title>ARRAY,MACRO variable. (ERROR with missing suffix )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911162#M359297</link>
      <description>&lt;P&gt;Good day to everyone.&lt;BR /&gt;Got some issue with...idk even what type of problem is...macro, arrays or even do loop.&lt;BR /&gt;%macro name(indata=,&amp;nbsp;some_num=);&lt;BR /&gt;data &amp;amp;indata_new;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;set &amp;amp;indata;&lt;BR /&gt;&lt;BR /&gt;array var_x_arr [*]&amp;nbsp; var_x1 - var_x&amp;amp;some_num.;&lt;BR /&gt;array var_y_arr [*]&amp;nbsp; var1_y - var&amp;amp;some_num._y;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; do j = 1 to dim(var_x_arr);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if var_y_arr (j) = "Y" then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; col4 = var_x_arr(j);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%name(indata=A,&amp;nbsp;some_num=2);&lt;BR /&gt;%name(indata=B,&amp;nbsp;some_num=5);&lt;BR /&gt;&lt;BR /&gt;So, the essence of my question is that I have 2 types of variables that are always together (var_x1 and var1_y)&lt;BR /&gt;In dataset A there are only 2 of them (that is, var_x1 var1_y and var_x2 var2_y)&lt;BR /&gt;In dataset B there are only 5 of them (that is, var_x1 - var_x5 and, accordingly, var1_y - var5_y)&lt;BR /&gt;var_x1 accepts text values&lt;BR /&gt;var2_y accepts either 'Y' or&amp;nbsp; 'N'&lt;BR /&gt;But it gives an error "ERROR: Missing numeric suffix on a numbered variable list (var_x1 - var_x2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;already triing&amp;nbsp; "&lt;BR /&gt;array var_x_arr [&amp;amp;some_num.]&amp;nbsp; var_x1 - var_x&amp;amp;some_num.;&lt;BR /&gt;array var_y_arr [&amp;amp;some_num.]&amp;nbsp; var1_y - var&amp;amp;some_num._y;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; do j = 1 to&amp;nbsp; &amp;amp;some_num.; "&lt;BR /&gt;and different variants writing with these syntax( with $ and without, " to dim()" and so on)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My version is 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 16:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911162#M359297</guid>
      <dc:creator>SMUGGLE</dc:creator>
      <dc:date>2024-01-10T16:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: ARRAY,MACRO variable. (ERROR with missing suffix )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911164#M359298</link>
      <description>&lt;P&gt;You cannot make a variable list using syntax like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var1_y - var5_y&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The number must be at the END of the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best thing would be to change your variable names. So something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var_y1 - var_y5 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise you will need to use macro code to generate that goofy series of names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array var_y_arr [*]  
%do i=1 to &amp;amp;some_num;
  var&amp;amp;i._y 
%end;
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So that you get this SAS code generated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array var_y_arr [*] var1_y var2_y var3_y var4_y var5_y ; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 17:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911164#M359298</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-10T17:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: ARRAY,MACRO variable. (ERROR with missing suffix )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911166#M359300</link>
      <description>&lt;P&gt;Turn on the macro debugging tools by running this command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then run your macro again and show us the ENTIRE log (that's every single line, every single character, do NOT select just the error messages). Include the log in the window that appears when you click on the &amp;lt;/&amp;gt; Icon. &lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1663012019648.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75161i0E71B1489A6C9839/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1663012019648.png" alt="PaigeMiller_0-1663012019648.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 16:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911166#M359300</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-10T16:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: ARRAY,MACRO variable. (ERROR with missing suffix )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911171#M359302</link>
      <description>"The number must at the END of the name" 🤦🤦🤦&lt;BR /&gt;EXACTLY&lt;BR /&gt;How could I forget about this.&lt;BR /&gt;Thanks a lot!)</description>
      <pubDate>Wed, 10 Jan 2024 17:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911171#M359302</guid>
      <dc:creator>SMUGGLE</dc:creator>
      <dc:date>2024-01-10T17:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: ARRAY,MACRO variable. (ERROR with missing suffix )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911173#M359304</link>
      <description>It's already been done.&lt;BR /&gt;&lt;BR /&gt;and i'm grateful for your attention to my question.&lt;BR /&gt;The main problem was in array variables name</description>
      <pubDate>Wed, 10 Jan 2024 17:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ARRAY-MACRO-variable-ERROR-with-missing-suffix/m-p/911173#M359304</guid>
      <dc:creator>SMUGGLE</dc:creator>
      <dc:date>2024-01-10T17:05:39Z</dc:date>
    </item>
  </channel>
</rss>

