<?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: Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595754#M171467</link>
    <description>&lt;P&gt;Since you do not have a variable subn1 (or subx1) in your input dataset, the array consists entirely of missing values.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2019 14:46:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-10-11T14:46:50Z</dc:date>
    <item>
      <title>Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595729#M171448</link>
      <description>&lt;P&gt;I get the following error with the code:&lt;/P&gt;&lt;P&gt;ERROR 124-185 when macro with array is invoked more than once in DATA step.&amp;nbsp; I have read the post but I don't quite understand how it applies to my code. The specific log is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;[90 array subn(*) subn1-subn34;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;124&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 124-185: The variable subn has already been defined.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;91 do i=1 to 34;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;92 SUBJ(i)=1/(1+exp(-subn(i)));&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;68&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 68-185: The function SUBN is unknown, or cannot be accessed.]&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;I need to know how to interpret and correct the error in my code since data test2 will not run but test1 runs just fine?&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input   param $  sub1  treat $ subn  ;
cards;
logit -1.11 ates -0.03
logit -1.11 bref -0.03 
ka2 -0.50  bref -0.01
ka2 -0.50 ates -0.01
;
run;


data test1;
set test;
if Param in(  'logit' );
array subj(*) subj1-subj34;
array sub(*) sub1-sub34;
do i=1 to 34;
subj(i)=1/(1+exp(-sub(i)));

end;
run;
RUN;

data test2;
set test;
if Param in(  'logit' );
array subj(*) subj1-subj34;
array subn(*) subn1-subn34;
do i=1 to 34;
SUBJ(i)=1/(1+exp(-subn(i)));
end;
run;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595729#M171448</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-10-11T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595735#M171452</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp; You have a variable in your Input dataset named SUBN. Therefore that causes a conflict with your 2nd array name at compile time in TEST2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;5655  data test2;
5656  set test;
5657  if Param in(  'logit' );
5658  array subj(*) subj1-subj34;
5659  array subn(*) subn1-subn34;run;
            ----
            124

ERROR 124-185: The variable subn has already been defined.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please choose a different array name.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595735#M171452</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-10-11T13:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595739#M171455</link>
      <description>I have tried that in the past and I changed it to:&lt;BR /&gt;&lt;BR /&gt;Data test2;&lt;BR /&gt;&lt;BR /&gt;Set test;&lt;BR /&gt;&lt;BR /&gt;..&lt;BR /&gt;&lt;BR /&gt;Array subx(*) subx1-subx34;&lt;BR /&gt;&lt;BR /&gt;..&lt;BR /&gt;&lt;BR /&gt;Subj(i)=1/(1+exp(-subx(i)));&lt;BR /&gt;&lt;BR /&gt;But my answer is&lt;BR /&gt;&lt;BR /&gt;Test 1&lt;BR /&gt;&lt;BR /&gt;Param sub1 treat subn subj1&lt;BR /&gt;&lt;BR /&gt;Logit -1.11 ates -0.03 0.24&lt;BR /&gt;&lt;BR /&gt;Test2&lt;BR /&gt;&lt;BR /&gt;Param sub1 treat subn subj1&lt;BR /&gt;&lt;BR /&gt;Logit -1.11 ates -0.03 .&lt;BR /&gt;&lt;BR /&gt;The test2 should have the result from the calculation&lt;BR /&gt;Subj(i)=1/(1+exp(-subx(i)));&lt;BR /&gt;&lt;BR /&gt;However I get a (.) for subj1 (i.e., no calculation value missing), but the&lt;BR /&gt;same code does give the correct answer for Test1.&lt;BR /&gt;&lt;BR /&gt;That is what I need to know why so Test2 can be corrected.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Oct 2019 14:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595739#M171455</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-10-11T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595754#M171467</link>
      <description>&lt;P&gt;Since you do not have a variable subn1 (or subx1) in your input dataset, the array consists entirely of missing values.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 14:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step/m-p/595754#M171467</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-11T14:46:50Z</dc:date>
    </item>
  </channel>
</rss>

