<?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: Issue using Array from SAS Viya Dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800102#M314697</link>
    <description>&lt;P&gt;Your macro is unnecessary, as the resulting dataset will contain the result from the last %DO loop iteration in any case, so it is sufficient to do the whole process once with the value of &amp;amp;cnt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, you have at least one value in schedule_id that falls outside of the range 1:1000. You can see in the log which value this is.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 11:03:09 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-03-04T11:03:09Z</dc:date>
    <item>
      <title>Issue using Array from SAS Viya Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800100#M314695</link>
      <description>&lt;P&gt;My program works fine when the dataset did not come from SAS Viya. However, if it came from viya, i receive this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Array subscript out of range at line 52 column 3.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the program. It throws an error the moment I add statuses(schedule_id) = return_cd1 and date_stat(schedule_id) = LOG_END_DTTM:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro arrange;&lt;BR /&gt;%do i=1 %to %trim(&amp;amp;cnt.);&lt;BR /&gt;/*In order for data step Job_Sch_Merge2 logic to work correctly, each _n_TH iteration should be placed at the bottom. */&lt;/P&gt;&lt;P&gt;data want want&amp;amp;i;&lt;BR /&gt;set Today_progress;&lt;BR /&gt;if &amp;amp;i=obs then output want&amp;amp;i; /*Every _n_=i will be added to want&amp;amp;i*/&lt;BR /&gt;else output want;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data Job_Sch_Merge2;&lt;BR /&gt;set want want&amp;amp;i; /*This will make the _n_TH iteration be placed at the bottom*/&lt;/P&gt;&lt;P&gt;array statuses(1000) _temporary_;&lt;BR /&gt;array date_stat(1000) _temporary_;&lt;/P&gt;&lt;P&gt;length pending_job $100;&lt;/P&gt;&lt;P&gt;statuses(schedule_id) = return_cd1;&lt;BR /&gt;date_stat(schedule_id) = LOG_END_DTTM;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%arrange;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 10:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800100#M314695</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2022-03-04T10:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using Array from SAS Viya Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800102#M314697</link>
      <description>&lt;P&gt;Your macro is unnecessary, as the resulting dataset will contain the result from the last %DO loop iteration in any case, so it is sufficient to do the whole process once with the value of &amp;amp;cnt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, you have at least one value in schedule_id that falls outside of the range 1:1000. You can see in the log which value this is.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 11:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800102#M314697</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-04T11:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using Array from SAS Viya Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800107#M314699</link>
      <description>&lt;P&gt;But how come my datasets created in non SAS Viya that is totally the same (parameters, values, and observation) with the dataset created in SAS Viya doesn't fail?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is also the sample of the log:&lt;/P&gt;&lt;P&gt;ERROR: Array subscript out of range at line 61 column 50.&lt;BR /&gt;LOG_END_DTTM=02DEC2020:16:35:17 SCHEDULE_ID=1200 return_cd1=1 obs=. pending_job= _ERROR_=1 _N_=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those values don't fail if the datasets don't come in non-SAS Viya&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 11:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800107#M314699</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2022-03-04T11:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using Array from SAS Viya Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800108#M314700</link>
      <description>&lt;P&gt;An array with a maximum index of 1000 CANNOT work with an index of 1200, PERIOD.&lt;/P&gt;
&lt;P&gt;Run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select min(schedule_id) as min_sched, max(schedule_id) as max_sched
from dataset;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for both datasets. You should also use PROC COMPARE before claiming that datasets are identical.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 11:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-using-Array-from-SAS-Viya-Dataset/m-p/800108#M314700</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-04T11:23:09Z</dc:date>
    </item>
  </channel>
</rss>

