<?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 ERROR: (execution) Invalid subscript or subscript out of range in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374891#M3591</link>
    <description>&lt;P&gt;Please help, how fix the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;750 DATA;&lt;BR /&gt;751 SET WWW;&lt;BR /&gt;752 %macro dropout(data=,id=,time=,response=, out=);&lt;BR /&gt;753 %if %bquote(&amp;amp;data)=%then %let data=&amp;amp;syslast;&lt;BR /&gt;754 proc freq data=&amp;amp;data noprint;&lt;BR /&gt;755 tables &amp;amp;id /out=freqid;&lt;BR /&gt;756 tables &amp;amp;time /out=freqtime;&lt;BR /&gt;757 run;&lt;BR /&gt;758 proc iml;&lt;BR /&gt;759 reset noprint;&lt;BR /&gt;760 use freqid;&lt;BR /&gt;761 read all var {&amp;amp;id};&lt;BR /&gt;762 nsub = nrow(&amp;amp;id);&lt;BR /&gt;763 use freqtime;&lt;BR /&gt;764 read all var {&amp;amp;time};&lt;BR /&gt;765 ntime = nrow(&amp;amp;time);&lt;BR /&gt;766 time=&amp;amp;time;&lt;BR /&gt;767 use &amp;amp;data;&lt;BR /&gt;768 read all var {&amp;amp;id &amp;amp;time &amp;amp;response};&lt;BR /&gt;769 n = nrow(&amp;amp;response);&lt;BR /&gt;770 dropout =j(n,1,0);&lt;BR /&gt;771 ind = 1;&lt;BR /&gt;772 do while (ind &amp;lt;= nsub);&lt;BR /&gt;773 j=1;&lt;BR /&gt;774 if (&amp;amp;response[(ind-1)*ntime+j]=.)&lt;BR /&gt;775 then print"First measurement is missing";&lt;BR /&gt;776 if (&amp;amp;response[(ind-1)*ntime+j]^=.)then&lt;BR /&gt;777 do;&lt;BR /&gt;778 j=ntime;&lt;BR /&gt;779 do until (j=1);&lt;BR /&gt;780 if (&amp;amp;response[(ind-1)*ntime+j]=.)then&lt;BR /&gt;781 do;&lt;BR /&gt;782 dropout [(ind-1)*ntime+j]=1;&lt;BR /&gt;783 j=j-1;&lt;BR /&gt;784 end;&lt;BR /&gt;785 else j=1;&lt;BR /&gt;786 end;&lt;BR /&gt;787 end;&lt;BR /&gt;788 ind=ind+1;&lt;BR /&gt;789 end;&lt;BR /&gt;790 prev=j(n,1,1);&lt;BR /&gt;791 prev[2:n] = &amp;amp;response[1:n-1];&lt;BR /&gt;792 i=1;&lt;BR /&gt;793 do while(i&amp;lt;=n);&lt;BR /&gt;794 if &amp;amp;time[i]=time[1] then prev [i]=.;&lt;BR /&gt;795 i=i+1;&lt;BR /&gt;796 end;&lt;BR /&gt;797 create help var {&amp;amp;id &amp;amp;time &amp;amp;response dropout prev};&lt;BR /&gt;798 append;&lt;BR /&gt;799 quit;&lt;BR /&gt;800 data &amp;amp;out;&lt;BR /&gt;801 merge &amp;amp;data help;&lt;BR /&gt;802 run;&lt;BR /&gt;803 %mend;&lt;BR /&gt;804 %dropout(data=WWW,id=hh,time=time,response=wt,out=wgee1);&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: The data set WORK.DATA12 has 598 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: The data set WORK.FREQID has 188 observations and 3 variables.&lt;BR /&gt;NOTE: The data set WORK.FREQTIME has 6 observations and 3 variables.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Writing HTML Body file: sashtml1.htm&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;ERROR: (execution) Invalid subscript or subscript out of range.&lt;/P&gt;&lt;P&gt;operation : [ at line 1386 column 24&lt;BR /&gt;operands : wt, _TEM1003&lt;BR /&gt;wt 598 rows 1 col (numeric)&lt;/P&gt;&lt;P&gt;_TEM1003 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;600&lt;/P&gt;&lt;P&gt;statement : IF at line 1386 column 11&lt;BR /&gt;NOTE: Exiting IML.&lt;BR /&gt;NOTE: The data set WORK.HELP has 598 observations and 5 variables.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IML used (Total process time):&lt;BR /&gt;real time 0.28 seconds&lt;BR /&gt;cpu time 0.09 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.HELP.&lt;BR /&gt;NOTE: The data set WORK.WGEE1 has 598 observations and 9 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;805 proc genmod data=wgee1 descending;&lt;BR /&gt;806 model wt = trt prev / pred dist=binomial; /*Here other baseline covariates can be added,&lt;BR /&gt;806! group=treatment*/&lt;BR /&gt;807 ods output obstats=pred;&lt;BR /&gt;808 run;&lt;/P&gt;&lt;P&gt;NOTE: PROC GENMOD is modeling the probability that wt='1'.&lt;BR /&gt;NOTE: The Pearson chi-square and deviance are not computed since the AGGREGATE option is not&lt;BR /&gt;specified.&lt;BR /&gt;NOTE: Algorithm converged.&lt;BR /&gt;NOTE: The scale parameter was held fixed.&lt;BR /&gt;NOTE: The data set WORK.PRED has 598 observations and 6 variables.&lt;BR /&gt;NOTE: PROCEDURE GENMOD used (Total process time):&lt;BR /&gt;real time 0.30 seconds&lt;BR /&gt;cpu time 0.15 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;809&lt;BR /&gt;810 data pred;&lt;BR /&gt;811 set pred;&lt;BR /&gt;812 keep observation pred;&lt;BR /&gt;813 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.PRED.&lt;BR /&gt;NOTE: The data set WORK.PRED has 598 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;814 data wgee1;&lt;BR /&gt;815 merge pred wgee1;&lt;BR /&gt;816 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.PRED.&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.WGEE1.&lt;BR /&gt;NOTE: The data set WORK.WGEE1 has 598 observations and 11 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jul 2017 11:16:56 GMT</pubDate>
    <dc:creator>Mabungane</dc:creator>
    <dc:date>2017-07-11T11:16:56Z</dc:date>
    <item>
      <title>ERROR: (execution) Invalid subscript or subscript out of range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374891#M3591</link>
      <description>&lt;P&gt;Please help, how fix the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;750 DATA;&lt;BR /&gt;751 SET WWW;&lt;BR /&gt;752 %macro dropout(data=,id=,time=,response=, out=);&lt;BR /&gt;753 %if %bquote(&amp;amp;data)=%then %let data=&amp;amp;syslast;&lt;BR /&gt;754 proc freq data=&amp;amp;data noprint;&lt;BR /&gt;755 tables &amp;amp;id /out=freqid;&lt;BR /&gt;756 tables &amp;amp;time /out=freqtime;&lt;BR /&gt;757 run;&lt;BR /&gt;758 proc iml;&lt;BR /&gt;759 reset noprint;&lt;BR /&gt;760 use freqid;&lt;BR /&gt;761 read all var {&amp;amp;id};&lt;BR /&gt;762 nsub = nrow(&amp;amp;id);&lt;BR /&gt;763 use freqtime;&lt;BR /&gt;764 read all var {&amp;amp;time};&lt;BR /&gt;765 ntime = nrow(&amp;amp;time);&lt;BR /&gt;766 time=&amp;amp;time;&lt;BR /&gt;767 use &amp;amp;data;&lt;BR /&gt;768 read all var {&amp;amp;id &amp;amp;time &amp;amp;response};&lt;BR /&gt;769 n = nrow(&amp;amp;response);&lt;BR /&gt;770 dropout =j(n,1,0);&lt;BR /&gt;771 ind = 1;&lt;BR /&gt;772 do while (ind &amp;lt;= nsub);&lt;BR /&gt;773 j=1;&lt;BR /&gt;774 if (&amp;amp;response[(ind-1)*ntime+j]=.)&lt;BR /&gt;775 then print"First measurement is missing";&lt;BR /&gt;776 if (&amp;amp;response[(ind-1)*ntime+j]^=.)then&lt;BR /&gt;777 do;&lt;BR /&gt;778 j=ntime;&lt;BR /&gt;779 do until (j=1);&lt;BR /&gt;780 if (&amp;amp;response[(ind-1)*ntime+j]=.)then&lt;BR /&gt;781 do;&lt;BR /&gt;782 dropout [(ind-1)*ntime+j]=1;&lt;BR /&gt;783 j=j-1;&lt;BR /&gt;784 end;&lt;BR /&gt;785 else j=1;&lt;BR /&gt;786 end;&lt;BR /&gt;787 end;&lt;BR /&gt;788 ind=ind+1;&lt;BR /&gt;789 end;&lt;BR /&gt;790 prev=j(n,1,1);&lt;BR /&gt;791 prev[2:n] = &amp;amp;response[1:n-1];&lt;BR /&gt;792 i=1;&lt;BR /&gt;793 do while(i&amp;lt;=n);&lt;BR /&gt;794 if &amp;amp;time[i]=time[1] then prev [i]=.;&lt;BR /&gt;795 i=i+1;&lt;BR /&gt;796 end;&lt;BR /&gt;797 create help var {&amp;amp;id &amp;amp;time &amp;amp;response dropout prev};&lt;BR /&gt;798 append;&lt;BR /&gt;799 quit;&lt;BR /&gt;800 data &amp;amp;out;&lt;BR /&gt;801 merge &amp;amp;data help;&lt;BR /&gt;802 run;&lt;BR /&gt;803 %mend;&lt;BR /&gt;804 %dropout(data=WWW,id=hh,time=time,response=wt,out=wgee1);&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: The data set WORK.DATA12 has 598 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: The data set WORK.FREQID has 188 observations and 3 variables.&lt;BR /&gt;NOTE: The data set WORK.FREQTIME has 6 observations and 3 variables.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Writing HTML Body file: sashtml1.htm&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;ERROR: (execution) Invalid subscript or subscript out of range.&lt;/P&gt;&lt;P&gt;operation : [ at line 1386 column 24&lt;BR /&gt;operands : wt, _TEM1003&lt;BR /&gt;wt 598 rows 1 col (numeric)&lt;/P&gt;&lt;P&gt;_TEM1003 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;600&lt;/P&gt;&lt;P&gt;statement : IF at line 1386 column 11&lt;BR /&gt;NOTE: Exiting IML.&lt;BR /&gt;NOTE: The data set WORK.HELP has 598 observations and 5 variables.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IML used (Total process time):&lt;BR /&gt;real time 0.28 seconds&lt;BR /&gt;cpu time 0.09 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.WWW.&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.HELP.&lt;BR /&gt;NOTE: The data set WORK.WGEE1 has 598 observations and 9 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;805 proc genmod data=wgee1 descending;&lt;BR /&gt;806 model wt = trt prev / pred dist=binomial; /*Here other baseline covariates can be added,&lt;BR /&gt;806! group=treatment*/&lt;BR /&gt;807 ods output obstats=pred;&lt;BR /&gt;808 run;&lt;/P&gt;&lt;P&gt;NOTE: PROC GENMOD is modeling the probability that wt='1'.&lt;BR /&gt;NOTE: The Pearson chi-square and deviance are not computed since the AGGREGATE option is not&lt;BR /&gt;specified.&lt;BR /&gt;NOTE: Algorithm converged.&lt;BR /&gt;NOTE: The scale parameter was held fixed.&lt;BR /&gt;NOTE: The data set WORK.PRED has 598 observations and 6 variables.&lt;BR /&gt;NOTE: PROCEDURE GENMOD used (Total process time):&lt;BR /&gt;real time 0.30 seconds&lt;BR /&gt;cpu time 0.15 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;809&lt;BR /&gt;810 data pred;&lt;BR /&gt;811 set pred;&lt;BR /&gt;812 keep observation pred;&lt;BR /&gt;813 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.PRED.&lt;BR /&gt;NOTE: The data set WORK.PRED has 598 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;814 data wgee1;&lt;BR /&gt;815 merge pred wgee1;&lt;BR /&gt;816 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 598 observations read from the data set WORK.PRED.&lt;BR /&gt;NOTE: There were 598 observations read from the data set WORK.WGEE1.&lt;BR /&gt;NOTE: The data set WORK.WGEE1 has 598 observations and 11 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 11:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374891#M3591</guid>
      <dc:creator>Mabungane</dc:creator>
      <dc:date>2017-07-11T11:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Invalid subscript or subscript out of range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374896#M3592</link>
      <description>&lt;P&gt;Confession: &amp;nbsp;I don't use IML. &amp;nbsp;On the other hand, this statement stands out:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do until (j=1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At least in theory, it is possible that ntime&amp;nbsp;could be a decimal fraction and therefore j could be a decimal fraction. &amp;nbsp;If that's the case, the UNTIL condition will never be met by substracting 1 from j. &amp;nbsp;It would be safer (and could conceivably fix the error condition) to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do until (j &amp;lt;= 1);&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 11:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374896#M3592</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-11T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Invalid subscript or subscript out of range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374898#M3593</link>
      <description>&lt;P&gt;It looks like the error is coming from macro %dropout(data=WWW,id=hh,time=time,response=wt,out=wgee1);&lt;/P&gt;
&lt;P&gt;And check the statement about WT .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;operation : [ at line 1386 column 24&lt;BR /&gt;operands : wt, _TEM1003&lt;BR /&gt;&lt;STRONG&gt;wt 598 rows 1 col (numeric)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;_TEM1003 1 row 1 col (numeric)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 11:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Invalid-subscript-or-subscript-out-of-range/m-p/374898#M3593</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-07-11T11:51:42Z</dc:date>
    </item>
  </channel>
</rss>

