<?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: Arrays in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/610036#M18026</link>
    <description>&lt;P&gt;When the do loop has finished, the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p09213s9jc2t99n1vx0omk2rh9ps.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;select()&lt;/A&gt; block checks the stage value of the last observation for a single id. Just add a check for missing there that &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p068vr83ld69mrn1fpvs67k5l5as.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;deletes&lt;/A&gt;&amp;nbsp;(= doesn't write) the observation.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 17:07:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-12-06T17:07:58Z</dc:date>
    <item>
      <title>Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608691#M17736</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;


options symbolgen mlogic mprint;
data nemo_test;
set nemo_stg_lmth;
array mth(11) &amp;amp;dt_nm;
if mth(11) = 3 then
Month = " ";
else if mth(11) = 2 then
do;
do i = 1 to 10;
if mth(i) = 3 then
do;
Month = i; leave;
end; end; end;
else;
if mth(11) = 1 then
do;
do i = 1 to 10;
if mth(i) = 3 then
do;
Month = i; leave;
end; end;
if Month = "" then 
do;
do i = 1 to 10;
if mth(i) = 2 then
do;
Month = i; leave;
end; end; end; end;
if Month NE "" then
S_Month = vname(mth(Month));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      29:4    31:9    34:4    39:4    42:4    49:4    54:21   
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
      36:9   44:9   51:9   
NOTE: Invalid character data, i=10.00 , at line 51 column 9.
NOTE: Invalid numeric data, Month='*' , at line 54 column 21.
ERROR: Array subscript out of range at line 54 column 17.
OriginalApplicationID=45913 December=1 January=1 February=1 March=1 April=1 May=1 June=1 July=1 August=1 September=2 October=1
Month=* i=10 S_Month=  _ERROR_=1 _N_=749
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 749 observations read from the data set WORK.NEMO_STG_LMTH.
WARNING: The data set WORK.NEMO_TEST may be incomplete.  When this step was stopped there were 748 observations and 15 variables.
WARNING: Data set WORK.NEMO_TEST was not replaced because this step was stopped.&lt;/PRE&gt;&lt;P&gt;Hi I have data something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i try the array for last 11 months of data, i am getting array subscript error: can someone please help me in resolving the issue&lt;/P&gt;&lt;P&gt;business logic:&lt;/P&gt;&lt;P&gt;1) if October Month(11) is 1 and Month(1-10) is 2 then that Month name should be printed&lt;/P&gt;&lt;P&gt;2) if October Month(11) is 2 and Month(1-10) is 3 then where ever month starts with 3 then that month name should be printed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g., from the error message i want month to be September.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nemo_stg.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34371i414D49FF38D75C11/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nemo_stg.PNG" alt="Nemo_stg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608691#M17736</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T13:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608696#M17738</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301412"&gt;@vnreddy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please share some sample data?&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608696#M17738</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-02T13:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608697#M17739</link>
      <description>&lt;P&gt;Why are you defining Month as character when you later want to use it as an index into an array?&lt;/P&gt;
&lt;P&gt;Why are you comparing your array elements with numbers, when they are defined as character?&lt;/P&gt;
&lt;P&gt;And why are you working so hard at making your code unreadable? Writing spaghetti garbage like this is guaranteed to cause problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post the log of the&amp;nbsp;&lt;EM&gt;whole&lt;/EM&gt; step so we can locate exactly which lines SAS is complaining about, the contents of macro variable &amp;amp;dt_nm, and dataset nemo_stg_lmth in usable form (data step with datalines).&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608697#M17739</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T13:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608698#M17740</link>
      <description>&lt;P&gt;Also please post the code you actually ran, as your code as posted can NEVER work, see this what I got after I formatted this spaghetti ****:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nemo_test;
set nemo_stg_lmth;
array mth(11) &amp;amp;dt_nm;
if mth(11) = 3
then Month = " ";
else if mth(11) = 2
then do;
  do i = 1 to 10;
    if mth(i) = 3 
    then do;
      Month = i;
      leave;
    end;
  end;
end;
else; /* null statement! */
if mth(11) = 1
then do;
  do i = 1 to 10;
    if mth(i) = 3
    then do;
    Month = i;
    leave;
  end;
end;
if Month = ""
then do;
  do i = 1 to 10;
    if mth(i) = 2
    then do;
      Month = i;
      leave;
    end;
  end;
end; end; /* this surplus end causes the step to fail at compilation! */
if Month NE "" then
S_Month = vname(mth(Month));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608698#M17740</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T13:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608707#M17745</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry about that, i am quite new to SAS and learning to put things together by gathering&lt;/P&gt;&lt;P&gt;some useful tips from SAS community&lt;/P&gt;&lt;P&gt;complete code so far i have used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and please see the sample data image:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let todaysDate = %sysfunc(today(), date9.);

data _null_;
/*last_month = intnx("Month", "&amp;amp;todaysDate."d, -1, "END");*/
/*call symputx ('last_month', put(last_month, date9.));*/
Month_back2 = intnx("Month", "&amp;amp;todaysDate."d, -2, "END");
call symputx ('Month_back2', put(Month_back2, date9.));
Month_back3 = intnx("Month", "&amp;amp;todaysDate."d, -3, "END");
call symputx ('Month_back3', put(Month_back3, date9.));
Month_back4 = intnx("Month", "&amp;amp;todaysDate."d, -4, "END");
Month_back12 = intnx("Month", "&amp;amp;todaysDate."d, -12, "END");
call symputx ('Month_back12', put(Month_back12, date9.));
run;


%put where date between "&amp;amp;Month_back12"d and "&amp;amp;last_month"d;
%put &amp;amp;todaysDate &amp;amp;last_month &amp;amp;Month_back2 &amp;amp;Month_back3 &amp;amp;Month_back4 &amp;amp;Month_back12;


data nemo.nemo_ecl_prod_t;
set nemo.nemo_ecl_prod;
run;

/*
proc contents data=nemo.nemo_ecl_prod_t;
run;
*/

data work.nemo_twelve_month (keep=OriginalApplicationID Stage ECL run_date nemo_date);
set nemo.nemo_ecl_prod_t;
where nemo_date between "&amp;amp;Month_back12."d and "&amp;amp;Month_back2"d /*"&amp;amp;last_month"d*/ /*and latest_run = 'Y'*/;
run;

PROC SQL;
CREATE TABLE WORK.nemo_month_fmt AS 
SELECT OriginalApplicationID, 
       Stage, 
       ECL, 
	   run_date max(run_date) as m_rundate,
       nemo_date,
	   nemo_date FORMAT=MONNAME9. AS Month
      FROM WORK.NEMO_TWELVE_MONTH;
QUIT;

data nemo_month_fmt_;
set nemo_month_fmt;
where OriginalApplicationID NE . ;
run;
/*
proc sort data=nemo_month_fmt_;
by originalapplicationid;
run;
*/

proc sql;
create table nemo_dup_month as
select *
from nemo_month_fmt
group by nemo_date
/*having nemo_date = max(nemo_date);*/
having m_rundate = max(m_rundate);
quit;

proc sort data=nemo_dup_month;
by originalapplicationid;
run;

proc transpose data=nemo_dup_month out=nemo_m_fmt(drop=_name_);
by originalapplicationid;
var stage;
id Month;
run;


options symbolgen mlogic mprint;
data nemo_test;
/*set nemo_stg_lmth;*/
set nemo_m_fmt;
array mth(11) December January February March April May June July August September October;
/*array mth(11) &amp;amp;dt_nm;*/
if mth(11) = 3 then
Month = " ";
else if mth(11) = 2 then
do;
do i = 1 to 10;
if mth(i) = 3 then
do;
Month = i; leave;
end; end; end;
else;
if mth(11) = 1 then
do;
do i = 1 to 10;
if mth(i) = 3 then
do;
Month = i; leave;
end; end;
if Month = "" then 
do;
do i = 1 to 10;
if mth(i) = 2 then
do;
Month = i; leave;
end; end; end; end;
if Month NE "" then
S_Month = vname(mth(Month));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nemo_stg.PNG" style="width: 492px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34373iDA02FB62DBC2191B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nemo_stg.PNG" alt="Nemo_stg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 14:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608707#M17745</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T14:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608717#M17748</link>
      <description>&lt;P&gt;OriginalApplicationID Stage ECL Nemo_date&lt;BR /&gt;7267 2 310.4922578 31-Dec-18&lt;BR /&gt;7267 2 284.1795028 31-Jan-19&lt;BR /&gt;7267 2 305.9252432 28-Feb-19&lt;BR /&gt;7267 2 647.556714 31-Mar-19&lt;BR /&gt;7267 3 932.4284102 30-Apr-19&lt;BR /&gt;7267 3 839.5357268 31-May-19&lt;BR /&gt;7267 3 806.460993 30-Jun-19&lt;BR /&gt;7267 3 739.9468882 31-Jul-19&lt;BR /&gt;7267 3 718.860982 31-Aug-19&lt;BR /&gt;7267 2 635.573145 30-Sep-19&lt;BR /&gt;7267 2 656.0290522 31-Oct-19&lt;BR /&gt;7793 1 35.58316204 31-Dec-18&lt;BR /&gt;7793 1 35.96957208 31-Jan-19&lt;BR /&gt;7793 1 55.3785582 28-Feb-19&lt;BR /&gt;7793 2 923.2837645 31-Mar-19&lt;BR /&gt;7793 2 919.0402749 30-Apr-19&lt;BR /&gt;7793 2 930.659084 31-May-19&lt;BR /&gt;7793 1 34.8811567 30-Jun-19&lt;BR /&gt;7793 1 34.65632422 31-Jul-19&lt;BR /&gt;7793 1 33.70968438 31-Aug-19&lt;BR /&gt;7793 1 33.07500636 30-Sep-19&lt;BR /&gt;7793 1 17.12617064 31-Oct-19&lt;BR /&gt;9434 1 7.189149224 31-Dec-18&lt;BR /&gt;9434 1 7.14900696 31-Jan-19&lt;BR /&gt;9434 1 7.022060722 28-Feb-19&lt;BR /&gt;9434 1 6.916268217 31-Mar-19&lt;BR /&gt;9434 1 6.792931518 30-Apr-19&lt;BR /&gt;9434 1 6.76085288 31-May-19&lt;BR /&gt;9434 1 6.681789709 30-Jun-19&lt;BR /&gt;9434 1 10.17436687 31-Jul-19&lt;BR /&gt;9434 2 891.1101093 31-Aug-19&lt;BR /&gt;9434 2 753.416957 30-Sep-19&lt;BR /&gt;9434 1 35.51067285 31-Oct-19&lt;BR /&gt;9523 1 20.49622488 31-Dec-18&lt;BR /&gt;9523 1 20.62410657 31-Jan-19&lt;BR /&gt;9523 1 20.31687893 28-Feb-19&lt;BR /&gt;9523 1 20.08796033 31-Mar-19&lt;BR /&gt;9523 1 19.77000246 30-Apr-19&lt;BR /&gt;9523 1 19.62216115 31-May-19&lt;BR /&gt;9523 1 19.48598417 30-Jun-19&lt;BR /&gt;9523 1 19.21695299 31-Jul-19&lt;BR /&gt;9523 1 18.77420846 31-Aug-19&lt;BR /&gt;9523 1 18.46826511 30-Sep-19&lt;BR /&gt;9523 1 18.18600003 31-Oct-19&lt;BR /&gt;9532 2 1622.924956 31-Dec-18&lt;BR /&gt;9532 2 1599.94398 31-Jan-19&lt;BR /&gt;9532 2 1550.340788 28-Feb-19&lt;BR /&gt;9532 2 1544.018303 31-Mar-19&lt;BR /&gt;9532 2 1574.572185 30-Apr-19&lt;BR /&gt;9532 2 1524.781151 31-May-19&lt;BR /&gt;9532 1 225.2265888 30-Jun-19&lt;BR /&gt;9532 1 225.396246 31-Jul-19&lt;BR /&gt;9532 1 194.0203314 31-Aug-19&lt;BR /&gt;9532 1 188.694135 30-Sep-19&lt;BR /&gt;9532 1 186.1166642 31-Oct-19&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 14:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608717#M17748</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T14:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608725#M17749</link>
      <description>&lt;P&gt;There is no variable run_date in your data.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608725#M17749</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T15:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608734#M17750</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry i have excluded run_date from that piece of data, i have multiple run_dates.&lt;/P&gt;&lt;P&gt;anyway we don't that column in output report, i have taken that column just extract latest run data.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608734#M17750</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608735#M17751</link>
      <description>&lt;P&gt;Your code uses run_date, so we need that in the example dataset.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608735#M17751</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T15:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608738#M17752</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OriginalApplicationID Stage ECL Nemo_date run_date&lt;BR /&gt;7267 2 310.4922578 31-Dec-18 03JAN19:06:10:18&lt;BR /&gt;7267 2 284.1795028 31-Jan-19 04FEB19:06:04:44&lt;BR /&gt;7267 2 305.9252432 28-Feb-19 04MAR19:10:55:37&lt;BR /&gt;7267 2 647.556714 31-Mar-19 02APR19:09:55:12&lt;BR /&gt;7267 3 932.4284102 30-Apr-19 02MAY19:06:46:31&lt;BR /&gt;7267 3 839.5357268 31-May-19 04JUN19:06:05:27&lt;BR /&gt;7267 3 806.460993 30-Jun-19 02JUL19:06:05:38&lt;BR /&gt;7267 3 739.9468882 31-Jul-19 02AUG19:16:50:19&lt;BR /&gt;7267 3 718.860982 31-Aug-19 03SEP19:06:03:59&lt;BR /&gt;7267 2 635.573145 30-Sep-19 02OCT19:06:04:18&lt;BR /&gt;7267 2 656.0290522 31-Oct-19 04NOV19:06:04:17&lt;BR /&gt;7793 1 35.58316204 31-Dec-18 03JAN19:06:10:18&lt;BR /&gt;7793 1 35.96957208 31-Jan-19 04FEB19:06:04:44&lt;BR /&gt;7793 1 55.3785582 28-Feb-19 04MAR19:10:55:37&lt;BR /&gt;7793 2 923.2837645 31-Mar-19 02APR19:09:55:12&lt;BR /&gt;7793 2 919.0402749 30-Apr-19 02MAY19:06:46:31&lt;BR /&gt;7793 2 930.659084 31-May-19 04JUN19:06:05:27&lt;BR /&gt;7793 1 34.8811567 30-Jun-19 02JUL19:06:05:38&lt;BR /&gt;7793 1 34.65632422 31-Jul-19 02AUG19:16:50:19&lt;BR /&gt;7793 1 33.70968438 31-Aug-19 03SEP19:06:03:59&lt;BR /&gt;7793 1 33.07500636 30-Sep-19 02OCT19:06:04:18&lt;BR /&gt;7793 1 17.12617064 31-Oct-19 04NOV19:06:04:17&lt;BR /&gt;9434 1 7.189149224 31-Dec-18 03JAN19:06:10:18&lt;BR /&gt;9434 1 7.14900696 31-Jan-19 04FEB19:06:04:44&lt;BR /&gt;9434 1 7.022060722 28-Feb-19 04MAR19:10:55:37&lt;BR /&gt;9434 1 6.916268217 31-Mar-19 02APR19:09:55:12&lt;BR /&gt;9434 1 6.792931518 30-Apr-19 02MAY19:06:46:31&lt;BR /&gt;9434 1 6.76085288 31-May-19 04JUN19:06:05:27&lt;BR /&gt;9434 1 6.681789709 30-Jun-19 02JUL19:06:05:38&lt;BR /&gt;9434 1 10.17436687 31-Jul-19 02AUG19:16:50:19&lt;BR /&gt;9434 2 891.1101093 31-Aug-19 03SEP19:06:03:59&lt;BR /&gt;9434 2 753.416957 30-Sep-19 02OCT19:06:04:18&lt;BR /&gt;9434 1 35.51067285 31-Oct-19 04NOV19:06:04:17&lt;BR /&gt;9523 1 20.49622488 31-Dec-18 03JAN19:06:10:18&lt;BR /&gt;9523 1 20.62410657 31-Jan-19 04FEB19:06:04:44&lt;BR /&gt;9523 1 20.31687893 28-Feb-19 04MAR19:10:55:37&lt;BR /&gt;9523 1 20.08796033 31-Mar-19 02APR19:09:55:12&lt;BR /&gt;9523 1 19.77000246 30-Apr-19 02MAY19:06:46:31&lt;BR /&gt;9523 1 19.62216115 31-May-19 04JUN19:06:05:27&lt;BR /&gt;9523 1 19.48598417 30-Jun-19 02JUL19:06:05:38&lt;BR /&gt;9523 1 19.21695299 31-Jul-19 02AUG19:16:50:19&lt;BR /&gt;9523 1 18.77420846 31-Aug-19 03SEP19:06:03:59&lt;BR /&gt;9523 1 18.46826511 30-Sep-19 02OCT19:06:04:18&lt;BR /&gt;9523 1 18.18600003 31-Oct-19 04NOV19:06:04:17&lt;BR /&gt;9532 2 1622.924956 31-Dec-18 03JAN19:06:10:18&lt;BR /&gt;9532 2 1599.94398 31-Jan-19 04FEB19:06:04:44&lt;BR /&gt;9532 2 1550.340788 28-Feb-19 04MAR19:10:55:37&lt;BR /&gt;9532 2 1544.018303 31-Mar-19 02APR19:09:55:12&lt;BR /&gt;9532 2 1574.572185 30-Apr-19 02MAY19:06:46:31&lt;BR /&gt;9532 2 1524.781151 31-May-19 04JUN19:06:05:27&lt;BR /&gt;9532 1 225.2265888 30-Jun-19 02JUL19:06:05:38&lt;BR /&gt;9532 1 225.396246 31-Jul-19 02AUG19:16:50:19&lt;BR /&gt;9532 1 194.0203314 31-Aug-19 03SEP19:06:03:59&lt;BR /&gt;9532 1 188.694135 30-Sep-19 02OCT19:06:04:18&lt;BR /&gt;9532 1 186.1166642 31-Oct-19 04NOV19:06:04:17&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608738#M17752</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T15:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608774#M17758</link>
      <description>&lt;P&gt;This code runs without ERRORS, WARNINGS or any extraneous NOTEs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nemo_ecl_prod;
input OriginalApplicationID Stage ECL Nemo_date :date9. run_date :date9.;
format Nemo_date run_date yymmddd10.;
datalines;
7267 2 310.4922578 31-Dec-18 03JAN19:06:10:18
7267 2 284.1795028 31-Jan-19 04FEB19:06:04:44
7267 2 305.9252432 28-Feb-19 04MAR19:10:55:37
7267 2 647.556714 31-Mar-19 02APR19:09:55:12
7267 3 932.4284102 30-Apr-19 02MAY19:06:46:31
7267 3 839.5357268 31-May-19 04JUN19:06:05:27
7267 3 806.460993 30-Jun-19 02JUL19:06:05:38
7267 3 739.9468882 31-Jul-19 02AUG19:16:50:19
7267 3 718.860982 31-Aug-19 03SEP19:06:03:59
7267 2 635.573145 30-Sep-19 02OCT19:06:04:18
7267 2 656.0290522 31-Oct-19 04NOV19:06:04:17
7793 1 35.58316204 31-Dec-18 03JAN19:06:10:18
7793 1 35.96957208 31-Jan-19 04FEB19:06:04:44
7793 1 55.3785582 28-Feb-19 04MAR19:10:55:37
7793 2 923.2837645 31-Mar-19 02APR19:09:55:12
7793 2 919.0402749 30-Apr-19 02MAY19:06:46:31
7793 2 930.659084 31-May-19 04JUN19:06:05:27
7793 1 34.8811567 30-Jun-19 02JUL19:06:05:38
7793 1 34.65632422 31-Jul-19 02AUG19:16:50:19
7793 1 33.70968438 31-Aug-19 03SEP19:06:03:59
7793 1 33.07500636 30-Sep-19 02OCT19:06:04:18
7793 1 17.12617064 31-Oct-19 04NOV19:06:04:17
9434 1 7.189149224 31-Dec-18 03JAN19:06:10:18
9434 1 7.14900696 31-Jan-19 04FEB19:06:04:44
9434 1 7.022060722 28-Feb-19 04MAR19:10:55:37
9434 1 6.916268217 31-Mar-19 02APR19:09:55:12
9434 1 6.792931518 30-Apr-19 02MAY19:06:46:31
9434 1 6.76085288 31-May-19 04JUN19:06:05:27
9434 1 6.681789709 30-Jun-19 02JUL19:06:05:38
9434 1 10.17436687 31-Jul-19 02AUG19:16:50:19
9434 2 891.1101093 31-Aug-19 03SEP19:06:03:59
9434 2 753.416957 30-Sep-19 02OCT19:06:04:18
9434 1 35.51067285 31-Oct-19 04NOV19:06:04:17
9523 1 20.49622488 31-Dec-18 03JAN19:06:10:18
9523 1 20.62410657 31-Jan-19 04FEB19:06:04:44
9523 1 20.31687893 28-Feb-19 04MAR19:10:55:37
9523 1 20.08796033 31-Mar-19 02APR19:09:55:12
9523 1 19.77000246 30-Apr-19 02MAY19:06:46:31
9523 1 19.62216115 31-May-19 04JUN19:06:05:27
9523 1 19.48598417 30-Jun-19 02JUL19:06:05:38
9523 1 19.21695299 31-Jul-19 02AUG19:16:50:19
9523 1 18.77420846 31-Aug-19 03SEP19:06:03:59
9523 1 18.46826511 30-Sep-19 02OCT19:06:04:18
9523 1 18.18600003 31-Oct-19 04NOV19:06:04:17
9532 2 1622.924956 31-Dec-18 03JAN19:06:10:18
9532 2 1599.94398 31-Jan-19 04FEB19:06:04:44
9532 2 1550.340788 28-Feb-19 04MAR19:10:55:37
9532 2 1544.018303 31-Mar-19 02APR19:09:55:12
9532 2 1574.572185 30-Apr-19 02MAY19:06:46:31
9532 2 1524.781151 31-May-19 04JUN19:06:05:27
9532 1 225.2265888 30-Jun-19 02JUL19:06:05:38
9532 1 225.396246 31-Jul-19 02AUG19:16:50:19
9532 1 194.0203314 31-Aug-19 03SEP19:06:03:59
9532 1 188.694135 30-Sep-19 02OCT19:06:04:18
9532 1 186.1166642 31-Oct-19 04NOV19:06:04:17
;

%let todaysDate = %sysfunc(today(), date9.);

data _null_;
last_month = intnx("Month", "&amp;amp;todaysDate."d, -1, "END");
call symputx ('last_month', put(last_month, date9.));
Month_back2 = intnx("Month", "&amp;amp;todaysDate."d, -2, "END");
call symputx ('Month_back2', put(Month_back2, date9.));
Month_back3 = intnx("Month", "&amp;amp;todaysDate."d, -3, "END");
call symputx ('Month_back3', put(Month_back3, date9.));
Month_back4 = intnx("Month", "&amp;amp;todaysDate."d, -4, "END");
Month_back12 = intnx("Month", "&amp;amp;todaysDate."d, -12, "END");
call symputx ('Month_back12', put(Month_back12, date9.));
run;


%put where date between "&amp;amp;Month_back12"d and "&amp;amp;last_month"d;
%put &amp;amp;todaysDate &amp;amp;last_month &amp;amp;Month_back2 &amp;amp;Month_back3 &amp;amp;Month_back12;


data nemo_ecl_prod_t;
set nemo_ecl_prod;
run;

/*
proc contents data=nemo.nemo_ecl_prod_t;
run;
*/

data nemo_twelve_month (keep=OriginalApplicationID Stage ECL run_date nemo_date);
set nemo_ecl_prod_t;
where nemo_date between "&amp;amp;Month_back12."d and "&amp;amp;Month_back2"d /*"&amp;amp;last_month"d*/ /*and latest_run = 'Y'*/;
run;

PROC SQL;
CREATE TABLE nemo_month_fmt AS 
SELECT OriginalApplicationID, 
       Stage, 
       ECL, 
	   run_date max(run_date) as m_rundate,
       nemo_date,
	   nemo_date FORMAT=MONNAME9. AS Month
      FROM NEMO_TWELVE_MONTH;
QUIT;

data nemo_month_fmt_;
set nemo_month_fmt;
where OriginalApplicationID NE . ;
run;
/*
proc sort data=nemo_month_fmt_;
by originalapplicationid;
run;
*/

proc sql;
create table nemo_dup_month as
select *
from nemo_month_fmt
group by nemo_date
/*having nemo_date = max(nemo_date);*/
having m_rundate = max(m_rundate);
quit;

proc sort data=nemo_dup_month;
by originalapplicationid;
run;

proc transpose data=nemo_dup_month out=nemo_m_fmt(drop=_name_);
by originalapplicationid;
var stage;
id Month;
run;


options symbolgen mlogic mprint;
data nemo_test;
/*set nemo_stg_lmth;*/
set nemo_m_fmt;
array mth(11) December January February March April May June July August September October;
/*array mth(11) &amp;amp;dt_nm;*/
if mth(11) = 3 then
Month = " ";
else if mth(11) = 2 then
do;
  do i = 1 to 10;
    if mth(i) = 3 then
    do;
      Month = i;
      leave;
    end;
  end;
end;
else;
if mth(11) = 1 then
do;
  do i = 1 to 10;
    if mth(i) = 3 then
    do;
      Month = i;
      leave;
    end;
  end;
  if Month = "" then 
  do;
    do i = 1 to 10;
      if mth(i) = 2 then
      do;
        Month = i;
        leave;
      end;
    end;
  end;
end;
if Month NE "" then
S_Month = vname(mth(Month));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 16:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608774#M17758</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T16:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608779#M17760</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;program is running fine without any errors, unfortunately, it's not fulfilling my requirement.&lt;/P&gt;&lt;P&gt;S_Month should be something like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OriginalApplicationID&amp;nbsp; &amp;nbsp; &amp;nbsp;S_Month&lt;/P&gt;&lt;P&gt;7267&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;April&lt;BR /&gt;7793&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;March&lt;BR /&gt;9434&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;August&lt;BR /&gt;9523&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;9532&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;December&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 17:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608779#M17760</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T17:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608792#M17761</link>
      <description>&lt;P&gt;What is the logical rule for selecting the month?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 17:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608792#M17761</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T17:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608793#M17762</link>
      <description>business logic:&lt;BR /&gt;&lt;BR /&gt;1) if October Month(11) is 1 and Month(1-10) is 2 then that Month name should be printed&lt;BR /&gt;&lt;BR /&gt;2) if October Month(11) is 2 and Month(1-10) is 3 then where ever month starts with 3 then that month name should be printed</description>
      <pubDate>Mon, 02 Dec 2019 17:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608793#M17762</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-02T17:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608804#M17766</link>
      <description>&lt;P&gt;Then that whole befuddling operation is unnecessary, one single data step does it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nemo_ecl_prod;
input OriginalApplicationID Stage ECL Nemo_date :date9. run_date :date9.;
format Nemo_date run_date yymmddd10.;
datalines;
7267 2 310.4922578 31-Dec-18 03JAN19:06:10:18
7267 2 284.1795028 31-Jan-19 04FEB19:06:04:44
7267 2 305.9252432 28-Feb-19 04MAR19:10:55:37
7267 2 647.556714 31-Mar-19 02APR19:09:55:12
7267 3 932.4284102 30-Apr-19 02MAY19:06:46:31
7267 3 839.5357268 31-May-19 04JUN19:06:05:27
7267 3 806.460993 30-Jun-19 02JUL19:06:05:38
7267 3 739.9468882 31-Jul-19 02AUG19:16:50:19
7267 3 718.860982 31-Aug-19 03SEP19:06:03:59
7267 2 635.573145 30-Sep-19 02OCT19:06:04:18
7267 2 656.0290522 31-Oct-19 04NOV19:06:04:17
7793 1 35.58316204 31-Dec-18 03JAN19:06:10:18
7793 1 35.96957208 31-Jan-19 04FEB19:06:04:44
7793 1 55.3785582 28-Feb-19 04MAR19:10:55:37
7793 2 923.2837645 31-Mar-19 02APR19:09:55:12
7793 2 919.0402749 30-Apr-19 02MAY19:06:46:31
7793 2 930.659084 31-May-19 04JUN19:06:05:27
7793 1 34.8811567 30-Jun-19 02JUL19:06:05:38
7793 1 34.65632422 31-Jul-19 02AUG19:16:50:19
7793 1 33.70968438 31-Aug-19 03SEP19:06:03:59
7793 1 33.07500636 30-Sep-19 02OCT19:06:04:18
7793 1 17.12617064 31-Oct-19 04NOV19:06:04:17
9434 1 7.189149224 31-Dec-18 03JAN19:06:10:18
9434 1 7.14900696 31-Jan-19 04FEB19:06:04:44
9434 1 7.022060722 28-Feb-19 04MAR19:10:55:37
9434 1 6.916268217 31-Mar-19 02APR19:09:55:12
9434 1 6.792931518 30-Apr-19 02MAY19:06:46:31
9434 1 6.76085288 31-May-19 04JUN19:06:05:27
9434 1 6.681789709 30-Jun-19 02JUL19:06:05:38
9434 1 10.17436687 31-Jul-19 02AUG19:16:50:19
9434 2 891.1101093 31-Aug-19 03SEP19:06:03:59
9434 2 753.416957 30-Sep-19 02OCT19:06:04:18
9434 1 35.51067285 31-Oct-19 04NOV19:06:04:17
9523 1 20.49622488 31-Dec-18 03JAN19:06:10:18
9523 1 20.62410657 31-Jan-19 04FEB19:06:04:44
9523 1 20.31687893 28-Feb-19 04MAR19:10:55:37
9523 1 20.08796033 31-Mar-19 02APR19:09:55:12
9523 1 19.77000246 30-Apr-19 02MAY19:06:46:31
9523 1 19.62216115 31-May-19 04JUN19:06:05:27
9523 1 19.48598417 30-Jun-19 02JUL19:06:05:38
9523 1 19.21695299 31-Jul-19 02AUG19:16:50:19
9523 1 18.77420846 31-Aug-19 03SEP19:06:03:59
9523 1 18.46826511 30-Sep-19 02OCT19:06:04:18
9523 1 18.18600003 31-Oct-19 04NOV19:06:04:17
9532 2 1622.924956 31-Dec-18 03JAN19:06:10:18
9532 2 1599.94398 31-Jan-19 04FEB19:06:04:44
9532 2 1550.340788 28-Feb-19 04MAR19:10:55:37
9532 2 1544.018303 31-Mar-19 02APR19:09:55:12
9532 2 1574.572185 30-Apr-19 02MAY19:06:46:31
9532 2 1524.781151 31-May-19 04JUN19:06:05:27
9532 1 225.2265888 30-Jun-19 02JUL19:06:05:38
9532 1 225.396246 31-Jul-19 02AUG19:16:50:19
9532 1 194.0203314 31-Aug-19 03SEP19:06:03:59
9532 1 188.694135 30-Sep-19 02OCT19:06:04:18
9532 1 186.1166642 31-Oct-19 04NOV19:06:04:17
;

data want;
set nemo_ecl_prod;
by OriginalApplicationID;
retain
  month2
  month3
;
if first.OriginalApplicationID
then do;
  month2 = .;
  month3 = .;
  month = .;
end;
if not last.OriginalApplicationID
then do;
  if month2 = . and stage = 2 then month2 = month(nemo_date);
  if month3 = . and stage = 3 then month3 = month(nemo_date);
end;
if last.OriginalApplicationID;
if stage = 1 and month2 ne . then month = put(mdy(month2,1,2019),monname.);
if stage = 2 and month3 ne . then month = put(mdy(month3,1,2019),monname.);
keep OriginalApplicationID month;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;OriginalApplicationID	month
7267	April
7793	March
9434	August
9523	 
9532	December&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/608804#M17766</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-02T18:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609009#M17789</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the program given by you..i am not getting any results in Month column. I am getting blank rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
22         
23         GOPTIONS ACCESSIBLE;
24         
25         data want;
26         set nemo_ecl_prod;
27         by OriginalApplicationID;
28         retain
29           month2
30           month3
31         ;
32         if first.OriginalApplicationID
33         then do;
34           month2 = .;
35           month3 = .;
36           month = .;
37         end;
38         if not last.OriginalApplicationID
39         then do;
40           if month2 = . and stage = 2 then month2 = month(nemo_date);
41           if month3 = . and stage = 3 then month3 = month(nemo_date);
42         end;
43         if last.OriginalApplicationID;
44         if stage = 1 and month2 ne . then month = put(mdy(month2,1,2019),monname.);
45         if stage = 2 and month3 ne . then month = put(mdy(month3,1,2019),monname.);
46         keep OriginalApplicationID month;
47         run;

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      44:43   45:43   
NOTE: Invalid numeric data, '    April' , at line 45 column 43.
OriginalApplicationID=7267 Stage=2 ECL=656.0290522 Nemo_date=2019-10-31 run_date=2019-11-04 FIRST.OriginalApplicationID=0
LAST.OriginalApplicationID=1 month2=12 month3=4 month=. _ERROR_=1 _N_=11
NOTE: Invalid numeric data, '    March' , at line 44 column 43.
OriginalApplicationID=7793 Stage=1 ECL=17.12617064 Nemo_date=2019-10-31 run_date=2019-11-04 FIRST.OriginalApplicationID=0
LAST.OriginalApplicationID=1 month2=3 month3=. month=. _ERROR_=1 _N_=22
2                                                          The SAS System                            10:25 Tuesday, December 3, 2019

NOTE: Invalid numeric data, '   August' , at line 44 column 43.
OriginalApplicationID=9434 Stage=1 ECL=35.51067285 Nemo_date=2019-10-31 run_date=2019-11-04 FIRST.OriginalApplicationID=0
LAST.OriginalApplicationID=1 month2=8 month3=. month=. _ERROR_=1 _N_=33
NOTE: Invalid numeric data, ' December' , at line 44 column 43.
OriginalApplicationID=9532 Stage=1 ECL=186.1166642 Nemo_date=2019-10-31 run_date=2019-11-04 FIRST.OriginalApplicationID=0
LAST.OriginalApplicationID=1 month2=12 month3=. month=. _ERROR_=1 _N_=55
NOTE: There were 55 observations read from the data set WORK.NEMO_ECL_PROD.
NOTE: The data set WORK.WANT has 5 observations and 2 variables.&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609009#M17789</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-03T11:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609015#M17791</link>
      <description>&lt;P&gt;Remove the line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  month = .;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;from the code (line 36 in your log). That's an artifact from testing it with purely numeric values.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609015#M17791</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-03T11:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609022#M17792</link>
      <description>Thank you so much</description>
      <pubDate>Tue, 03 Dec 2019 11:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609022#M17792</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-03T11:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609096#M17816</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;program what you gave yesterday worked fine with the data what i have yesterday, unfortunately, it's not working&lt;/P&gt;&lt;P&gt;with another piece of data with different stages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;OriginalApplicationID November December January February March April May June July August September October&lt;BR /&gt;113 2 2 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;767 2 2 2 2 2 2 1 1 1 2 1 1&lt;BR /&gt;1606 2 2 2 1 1 1 1 1 1 1 1 1&lt;BR /&gt;4745 1 1 1 1 1 1 2 1 1 1 1 1&lt;BR /&gt;4750 2 2 2 2 2 2 2 2 2 2 1 1&lt;BR /&gt;4769 3 3 3 3 3 3 3 3 3 3 3 2&lt;BR /&gt;4964 2 2 2 2 2 2 2 1 1 1 2 1&lt;BR /&gt;5585 1 1 1 2 2 1 1 1 1 1 1 1&lt;BR /&gt;5601 2 2 2 2 2 2 2 1 1 1 1 1&lt;BR /&gt;5608 1 1 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;6993 1 1 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;7267 2 2 2 2 2 3 3 3 3 3 2 2&lt;BR /&gt;7793 1 1 1 1 2 2 2 1 1 1 1 1&lt;BR /&gt;8160 3 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;8691 1 1 1 1 2 2 2 2 2 1 1 1&lt;BR /&gt;8758 1 1 1 1 1 2 2 2 1 1 1 1&lt;BR /&gt;253 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;254 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;424 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;467 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;509 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;585 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;618 3 3 3 3 3 3 3 3 3 3 3 3&lt;BR /&gt;646 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;654 1 1 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output&lt;BR /&gt;OriginalApplicationID November December January February March April May June July August September October Default&lt;BR /&gt;113 2 2 2 2 2 1 1 1 1 1 1 1 November&lt;BR /&gt;767 2 2 2 2 2 2 1 1 1 2 1 1 November&lt;BR /&gt;1606 2 2 2 1 1 1 1 1 1 1 1 1 November&lt;BR /&gt;4745 1 1 1 1 1 1 2 1 1 1 1 1 May&lt;BR /&gt;4750 2 2 2 2 2 2 2 2 2 2 1 1 November&lt;BR /&gt;4769 3 3 3 3 3 3 3 3 3 3 3 2 November&lt;BR /&gt;4964 2 2 2 2 2 2 2 1 1 1 2 1 November&lt;BR /&gt;5585 1 1 1 2 2 1 1 1 1 1 1 1 February&lt;BR /&gt;5601 2 2 2 2 2 2 2 1 1 1 1 1 November&lt;BR /&gt;5608 1 1 2 2 2 1 1 1 1 1 1 1 January&lt;BR /&gt;6993 1 1 2 2 2 1 1 1 1 1 1 1 January&lt;BR /&gt;7267 2 2 2 2 2 3 3 3 3 3 2 2 April&lt;BR /&gt;7793 1 1 1 1 2 2 2 1 1 1 1 1 March&lt;BR /&gt;8160 3 2 2 2 2 2 2 2 2 2 2 2 November&lt;BR /&gt;8691 1 1 1 1 2 2 2 2 2 1 1 1 March&lt;BR /&gt;8758 1 1 1 1 1 2 2 2 1 1 1 1 April&lt;BR /&gt;253 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;254 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;424 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;467 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;509 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;585 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;618 3 3 3 3 3 3 3 3 3 3 3 3&lt;BR /&gt;646 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;654 1 1 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 15:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609096#M17816</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2019-12-03T15:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609569#M17904</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301412"&gt;@vnreddy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;program what you gave yesterday worked fine with the data what i have yesterday, unfortunately, it's not working&lt;/P&gt;
&lt;P&gt;with another piece of data with different stages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Input&lt;/P&gt;
&lt;P&gt;OriginalApplicationID November December January February March April May June July August September October&lt;BR /&gt;113 2 2 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;767 2 2 2 2 2 2 1 1 1 2 1 1&lt;BR /&gt;1606 2 2 2 1 1 1 1 1 1 1 1 1&lt;BR /&gt;4745 1 1 1 1 1 1 2 1 1 1 1 1&lt;BR /&gt;4750 2 2 2 2 2 2 2 2 2 2 1 1&lt;BR /&gt;4769 3 3 3 3 3 3 3 3 3 3 3 2&lt;BR /&gt;4964 2 2 2 2 2 2 2 1 1 1 2 1&lt;BR /&gt;5585 1 1 1 2 2 1 1 1 1 1 1 1&lt;BR /&gt;5601 2 2 2 2 2 2 2 1 1 1 1 1&lt;BR /&gt;5608 1 1 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;6993 1 1 2 2 2 1 1 1 1 1 1 1&lt;BR /&gt;7267 2 2 2 2 2 3 3 3 3 3 2 2&lt;BR /&gt;7793 1 1 1 1 2 2 2 1 1 1 1 1&lt;BR /&gt;8160 3 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;8691 1 1 1 1 2 2 2 2 2 1 1 1&lt;BR /&gt;8758 1 1 1 1 1 2 2 2 1 1 1 1&lt;BR /&gt;253 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;254 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;424 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;467 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;509 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;585 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;618 3 3 3 3 3 3 3 3 3 3 3 3&lt;BR /&gt;646 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;654 1 1 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected output&lt;BR /&gt;OriginalApplicationID November December January February March April May June July August September October Default&lt;BR /&gt;113 2 2 2 2 2 1 1 1 1 1 1 1 November&lt;BR /&gt;767 2 2 2 2 2 2 1 1 1 2 1 1 November&lt;BR /&gt;1606 2 2 2 1 1 1 1 1 1 1 1 1 November&lt;BR /&gt;4745 1 1 1 1 1 1 2 1 1 1 1 1 May&lt;BR /&gt;4750 2 2 2 2 2 2 2 2 2 2 1 1 November&lt;BR /&gt;4769 3 3 3 3 3 3 3 3 3 3 3 2 November&lt;BR /&gt;4964 2 2 2 2 2 2 2 1 1 1 2 1 November&lt;BR /&gt;5585 1 1 1 2 2 1 1 1 1 1 1 1 February&lt;BR /&gt;5601 2 2 2 2 2 2 2 1 1 1 1 1 November&lt;BR /&gt;5608 1 1 2 2 2 1 1 1 1 1 1 1 January&lt;BR /&gt;6993 1 1 2 2 2 1 1 1 1 1 1 1 January&lt;BR /&gt;7267 2 2 2 2 2 3 3 3 3 3 2 2 April&lt;BR /&gt;7793 1 1 1 1 2 2 2 1 1 1 1 1 March&lt;BR /&gt;8160 3 2 2 2 2 2 2 2 2 2 2 2 November&lt;BR /&gt;8691 1 1 1 1 2 2 2 2 2 1 1 1 March&lt;BR /&gt;8758 1 1 1 1 1 2 2 2 1 1 1 1 April&lt;BR /&gt;253 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;254 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;424 2 2 2 2 2 2 2 2 2 2 2 2&lt;BR /&gt;467 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;509 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;585 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;618 3 3 3 3 3 3 3 3 3 3 3 3&lt;BR /&gt;646 1 1 1 1 1 1 1 1 1 1 1 1&lt;BR /&gt;654 1 1 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please note that the code that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;used starts with a data set using:&lt;/P&gt;
&lt;PRE&gt;input OriginalApplicationID Stage ECL Nemo_date :date9. run_date :date9.;
&lt;/PRE&gt;
&lt;P&gt;Your above data example apparently has variables:&lt;/P&gt;
&lt;PRE&gt;OriginalApplicationID November December January February March April May June July August September October&lt;/PRE&gt;
&lt;P&gt;Since the number and types of variables have almost no match I would be very surprised if the code ran on other types of data.&lt;/P&gt;
&lt;P&gt;Please note that Kurt's data has 2 date varaibles and your last example has no date variables. You would have to transform your data to look like the other data set to have a chance of getting the code to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are referring to this part of Kurt's code:&lt;/P&gt;
&lt;PRE&gt;data nemo_test;
/*set nemo_stg_lmth;*/
set nemo_m_fmt;
array mth(11) December January February March April May June July August September October;
/*array mth(11) &amp;amp;dt_nm;*/
if mth(11) = 3 then
Month = " ";
else if mth(11) = 2 then
do;
  do i = 1 to 10;
    if mth(i) = 3 then
    do;
      Month = i;
      leave;
    end;
  end;
end;
else;
if mth(11) = 1 then
do;
  do i = 1 to 10;
    if mth(i) = 3 then
    do;
      Month = i;
      leave;
    end;
  end;
  if Month = "" then 
  do;
    do i = 1 to 10;
      if mth(i) = 2 then
      do;
        Month = i;
        leave;
      end;
    end;
  end;
end;
if Month NE "" then
S_Month = vname(mth(Month));
run;&lt;/PRE&gt;
&lt;P&gt;Then you need to note that your are including MORE variables (November), the order would change since where December was first position it is now second.&lt;/P&gt;
&lt;P&gt;So please show the actual code that you attempted against the new "data" that includes all of the adjustments you needed to make to address the additional variable and the changed positions of the like named data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 23:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Arrays/m-p/609569#M17904</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-04T23:40:00Z</dc:date>
    </item>
  </channel>
</rss>

