<?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: Array subscript out of range at line 1602 column 8. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581852#M13747</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm try to use array to transpose long to wide format. However, the log shows "ERRO: Array subscript out of range at line 1602 column 8." Could you please tell me where the problem is?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1586 data test;&lt;BR /&gt;1587 set C1_10;&lt;BR /&gt;1588 by casid;&lt;BR /&gt;1589&lt;BR /&gt;1590 retain&lt;BR /&gt;1591 ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1592&lt;BR /&gt;1593 array aACEMED{8} ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1594&lt;BR /&gt;1595&lt;BR /&gt;1596 if first.casid then do;&lt;BR /&gt;1597 do i=1 to 8;&lt;BR /&gt;1598 aACEMED{i}=.;&lt;BR /&gt;1599 end;&lt;BR /&gt;1600 end;&lt;BR /&gt;1601&lt;BR /&gt;1602 aACEMED{EXAMN}=ACEMED;&lt;BR /&gt;1603&lt;BR /&gt;1604 if last.casid then output;&lt;BR /&gt;1605&lt;BR /&gt;1606 keep casid&lt;BR /&gt;1607 ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1608&lt;BR /&gt;1609 run;&lt;/P&gt;&lt;P&gt;ERROR: Array subscript out of range at line 1602 column 8.&lt;BR /&gt;CASID=7 WT=62 GHB=7.4 TOALC=0 SMEVR=1 SMNOW=0 NHTN=0 TCHOL=245 HDL=45 TRIG=158 LDL=168&lt;BR /&gt;AGE=44.07118412 DUR=30.71321013 SBP=109 DBP=60 THENAER=2.625374813 EXAMN=10 WHR=0.857580398&lt;BR /&gt;BMI=23.77095534 LVEDU=3 HINYR=1 TOTUNI=50 MARST=3 FHHBP=1 WBC=4.5 REABP=0 ACEMED=0 LIPMED=0&lt;BR /&gt;GFRCG=100.3226373 ESTGDR=8.824056209 Fromcycle=10 DCCTA1c=7.7407407407 totuniwt=0.8064516129&lt;BR /&gt;observed=1 FIRST.CASID=0 LAST.CASID=1 ACEMED1=0 ACEMED2=0 ACEMED3=0 ACEMED4=0 ACEMED5=0&lt;BR /&gt;ACEMED6=0 ACEMED8=. ACEMED10=0 i=. _ERROR_=1 _N_=8&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: There were 9 observations read from the data set WORK.C1_10.&lt;BR /&gt;WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 9 variables.&lt;BR /&gt;WARNING: Data set WORK.TEST was not replaced because this step was stopped.&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>Fri, 16 Aug 2019 20:36:55 GMT</pubDate>
    <dc:creator>Vivian_Vivian</dc:creator>
    <dc:date>2019-08-16T20:36:55Z</dc:date>
    <item>
      <title>ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581852#M13747</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm try to use array to transpose long to wide format. However, the log shows "ERRO: Array subscript out of range at line 1602 column 8." Could you please tell me where the problem is?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1586 data test;&lt;BR /&gt;1587 set C1_10;&lt;BR /&gt;1588 by casid;&lt;BR /&gt;1589&lt;BR /&gt;1590 retain&lt;BR /&gt;1591 ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1592&lt;BR /&gt;1593 array aACEMED{8} ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1594&lt;BR /&gt;1595&lt;BR /&gt;1596 if first.casid then do;&lt;BR /&gt;1597 do i=1 to 8;&lt;BR /&gt;1598 aACEMED{i}=.;&lt;BR /&gt;1599 end;&lt;BR /&gt;1600 end;&lt;BR /&gt;1601&lt;BR /&gt;1602 aACEMED{EXAMN}=ACEMED;&lt;BR /&gt;1603&lt;BR /&gt;1604 if last.casid then output;&lt;BR /&gt;1605&lt;BR /&gt;1606 keep casid&lt;BR /&gt;1607 ACEMED1-ACEMED6 ACEMED8 ACEMED10;&lt;BR /&gt;1608&lt;BR /&gt;1609 run;&lt;/P&gt;&lt;P&gt;ERROR: Array subscript out of range at line 1602 column 8.&lt;BR /&gt;CASID=7 WT=62 GHB=7.4 TOALC=0 SMEVR=1 SMNOW=0 NHTN=0 TCHOL=245 HDL=45 TRIG=158 LDL=168&lt;BR /&gt;AGE=44.07118412 DUR=30.71321013 SBP=109 DBP=60 THENAER=2.625374813 EXAMN=10 WHR=0.857580398&lt;BR /&gt;BMI=23.77095534 LVEDU=3 HINYR=1 TOTUNI=50 MARST=3 FHHBP=1 WBC=4.5 REABP=0 ACEMED=0 LIPMED=0&lt;BR /&gt;GFRCG=100.3226373 ESTGDR=8.824056209 Fromcycle=10 DCCTA1c=7.7407407407 totuniwt=0.8064516129&lt;BR /&gt;observed=1 FIRST.CASID=0 LAST.CASID=1 ACEMED1=0 ACEMED2=0 ACEMED3=0 ACEMED4=0 ACEMED5=0&lt;BR /&gt;ACEMED6=0 ACEMED8=. ACEMED10=0 i=. _ERROR_=1 _N_=8&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: There were 9 observations read from the data set WORK.C1_10.&lt;BR /&gt;WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 9 variables.&lt;BR /&gt;WARNING: Data set WORK.TEST was not replaced because this step was stopped.&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>Fri, 16 Aug 2019 20:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581852#M13747</guid>
      <dc:creator>Vivian_Vivian</dc:creator>
      <dc:date>2019-08-16T20:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581854#M13748</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285498"&gt;@Vivian_Vivian&lt;/a&gt;&amp;nbsp; &amp;nbsp;Did you notice in your log-&amp;nbsp;&lt;STRONG&gt; EXAMN=10&amp;nbsp;&lt;/STRONG&gt; while you have only 8 elements in your array? I guess that says it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ERROR: Array subscript out of range at line 1602 column 8.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CASID=7 WT=62 GHB=7.4 TOALC=0 SMEVR=1 SMNOW=0 NHTN=0 TCHOL=245 HDL=45 TRIG=158 LDL=168&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AGE=44.07118412 DUR=30.71321013 SBP=109 DBP=60 THENAER=2.625374813 &lt;STRONG&gt;EXAMN=10&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 20:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581854#M13748</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-16T20:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581856#M13749</link>
      <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;. I only have 8 exams in total (Exam1-EXAM6 EXAM8 EXAM10). The EXAM7 and EXAM9 are missing for every ID in the data set.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 20:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581856#M13749</guid>
      <dc:creator>Vivian_Vivian</dc:creator>
      <dc:date>2019-08-16T20:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581857#M13750</link>
      <description>&lt;P&gt;so of course you can't use the variable&amp;nbsp;&lt;STRONG&gt;EXAMN as array index&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 20:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581857#M13750</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-16T20:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581861#M13753</link>
      <description>&lt;P&gt;Do you mean the&amp;nbsp;&lt;STRONG&gt;array index EXAMN &lt;/STRONG&gt;has to be&amp;nbsp;continuous integral numbers without skips?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 20:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581861#M13753</guid>
      <dc:creator>Vivian_Vivian</dc:creator>
      <dc:date>2019-08-16T20:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581862#M13754</link>
      <description>&lt;P&gt;When you define an array with N elements , the array reference cannot be outside that range i.e For example, should N be 10, the lower bound is always 1 and upper bound is 10. If you happen to reference the array with number say 12&amp;nbsp; or 0, that implies out of range&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please do not confuse with number suffix as an indicator of number of elements in an array&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 21:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581862#M13754</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-16T21:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581865#M13756</link>
      <description>&lt;P&gt;Got it!&amp;nbsp; &amp;nbsp; &amp;nbsp;thanks a lot !&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 21:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581865#M13756</guid>
      <dc:creator>Vivian_Vivian</dc:creator>
      <dc:date>2019-08-16T21:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581905#M13763</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285498"&gt;@Vivian_Vivian&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;. I only have 8 exams in total (Exam1-EXAM6 EXAM8 EXAM10). The EXAM7 and EXAM9 are missing for every ID in the data set.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why not just define the array using EXAM1-EXAM10 anyway?&lt;/P&gt;
&lt;P&gt;Then the index into the array will match the suffix on the variable name.&lt;/P&gt;
&lt;P&gt;You can always drop the EXAM7 and EXAM9 variables if you don't need them.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2019 05:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581905#M13763</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-17T05:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Array subscript out of range at line 1602 column 8.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581969#M13775</link>
      <description>&lt;P&gt;Yes! That's what I did and it worked out!&amp;nbsp; Thanks for your reply&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2019 20:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Array-subscript-out-of-range-at-line-1602-column-8/m-p/581969#M13775</guid>
      <dc:creator>Vivian_Vivian</dc:creator>
      <dc:date>2019-08-17T20:08:03Z</dc:date>
    </item>
  </channel>
</rss>

