<?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: How to recode sequential values base on the previous value by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760514#M240495</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;&amp;nbsp;Below code addressing your initial question.&lt;/P&gt;
&lt;P&gt;Not sure what this array galore you've posted now is about but it appears you're now dealing with a totally different data structure. Please provide some sample data (via a SAS data step) and explain/show how the desired result needs to look like.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines dsd truncover;
  input id:$9. Year variable_have variable_want;
  datalines;
X4T39JHGK,2012,1,1
X4T39JHGK,2013,0,1
X4T39JHGK,2014, ,1
X4T39JHGK,2015,-9999,1
X4T39JHGK,2016,1,1
EZQA42HWD,2015,0,0
EZQA42HWD,2016,0,0
EZQA42HWD,2017,0,0
EZQA42HWD,2018,1,1
EZQA42HWD,2019,0,1
EZQA42HWD,2020, ,1
EZQA42HWD,2021,-9999,1
APJV74TMX,2015,-9999,-9999
APJV74TMX,2016,0,-9999
APJV74TMX,2017,0,-9999
APJV74TMX,2018,1,1
APJV74TMX,2019,0,1
APJV74TMX,2020, ,1
APJV74TMX,2021,-9999,1
CRMGKSEZH,2015, , 
CRMGKSEZH,2016, , 
CRMGKSEZH,2017,0,0
CRMGKSEZH,2018,-9999,-9999
CRMGKSEZH,2019,0,-9999
CRMGKSEZH,2020, ,-9999
CRMGKSEZH,2021,1,1
;

proc sort data=have;
  by id year;
run;

/* variable_derived: retain value based on value priority */
proc format;
  invalue value_prio
    1     =1
    -9999 =2
    0     =3
    other =4
  ;
run;

data want;
  set have;
  by id year;
  retain variable_derived;

  if first.id then
    variable_derived=variable_have;
  else if input(variable_have,value_prio.)&amp;lt;input(variable_derived,value_prio.) then
    variable_derived=variable_have;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Aug 2021 02:25:49 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-08-10T02:25:49Z</dc:date>
    <item>
      <title>How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759979#M240261</link>
      <description>&lt;P&gt;I need to create "variable_want" base on "variable_have" by each "id" and with "year" sorted ascending as shown in the table below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;variable_have has 4 values (missing, 0, 1, -9999) and variable_want should be created as shown below. I would highly appreciate if anyone can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Le&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;variable_have&lt;/TD&gt;&lt;TD&gt;variable_want&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X4T39JHGK&lt;/TD&gt;&lt;TD&gt;2012&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X4T39JHGK&lt;/TD&gt;&lt;TD&gt;2013&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X4T39JHGK&lt;/TD&gt;&lt;TD&gt;2014&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X4T39JHGK&lt;/TD&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X4T39JHGK&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EZQA42HWD&lt;/TD&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APJV74TMX&lt;/TD&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;-9999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CRMGKSEZH&lt;/TD&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759979#M240261</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-06T15:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759983#M240265</link>
      <description>&lt;P&gt;That shouldn't be overly difficult.&amp;nbsp; Have you tried using a Retained variable to hold (or the LAG function) the prior value and then just replace the existing value if and only if the current value is greater than the prior value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759983#M240265</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-06T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759987#M240267</link>
      <description>&lt;P&gt;What is the explicit rule that makes the variable_want value for APJV74TMX and&amp;nbsp;CRMGKSEZH stop being -9999 and switch to 1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Programs implement rules. An example is insufficient without the rule(s) involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could guess at least two different rules but you know what you want. So tell us the rule you are using to make the switches.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759987#M240267</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-06T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759997#M240271</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the below program should give you what you want.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Want;
	DROP	_:;
	SET	Have;
		BY	ID Year	NOTSORTED;
	RETAIN	_Prior_Have;
	RETAIN	_Prior_Test;

	IF	Variable_Have			=	-9999		THEN
		_Test_Have				=	0.5;
	ELSE
		_Test_Have				=	Variable_Have;
	
	IF	_Test_Have				&amp;gt;	_Prior_Test	THEN
		DO;
			Variable_Want		=	Variable_Have;
			_Prior_Have			=	Variable_Have;
			_Prior_Test			=	_Test_Have;
		END;
	ELSE
		DO;
			Variable_Want		=	_Prior_Have;
		END;

	IF	LAST.ID									THEN
		DO;
			CALL	MISSING(_Prior_Test, _Prior_Have);
		END;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628264599806.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62343iB49D3A72CCD4F131/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1628264599806.png" alt="jimbarbour_0-1628264599806.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/759997#M240271</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-06T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760394#M240448</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&amp;nbsp; I will give it a try and will let you know if It works.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Le&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 15:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760394#M240448</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T15:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760414#M240458</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;I tried the code (see below) but it still did not work the way I want. If the first.variable_have=missing then variable_want should be missing (it =0 then I run the code). Also, if variable_have=1 then variable_want should=1 and all years after that variable_want should all =1 (it works for most of the time but it did not work when variable_have=-9999, the variable_want still=-9999, not =1 as I wanted.. Could you please help to review the code below to see if I did anything wrong?&lt;/P&gt;&lt;P&gt;I really appreciate your help!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Le&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set cc_iv_sv;&lt;BR /&gt;by SubjectId_Latest _date_of_visit NOTSORTED;&lt;BR /&gt;retain _ich_hist_te _hcv_hist_te _hbv_hist_te _hiv_hist_te _invas_joint_proc_hist_te _hav_vacc_hist_te _hbv_vacc_hist_te _circum_te _hysterectomy_te&lt;BR /&gt;_family_hist_te _inhi_iti_his_te _inhi_immune_modulation_hist_te _joint_ble_hist_te _known_genetic_mutation_te&lt;BR /&gt;_cvad_te;&lt;BR /&gt;retain _ich_hist_ha _hcv_hist_ha _hbv_hist_ha _hiv_hist_ha _invas_joint_proc_hist_ha _hav_vacc_hist_ha _hbv_vacc_hist_ha _circum_ha _hysterectomy_ha&lt;BR /&gt;_family_hist_ha _inhi_iti_his_ha _inhi_immune_modulation_hist_ha _joint_ble_hist_ha _known_genetic_mutation_ha&lt;BR /&gt;_cvad_ha;&lt;BR /&gt;array dyn(*) _ich_hist _hcv_hist _hbv_hist _hiv_hist _invas_joint_proc_hist _hav_vacc_hist _hbv_vacc_hist _circum _hysterectomy&lt;BR /&gt;_family_hist _inhi_iti_his _inhi_immune_modulation_hist _joint_ble_hist _known_genetic_mutation&lt;BR /&gt;_cvad;&lt;BR /&gt;array dynb(*) _ich_hist_ddd _hcv_hist_ddd _hbv_hist_ddd _hiv_hist_ddd _invas_joint_proc_hist_ddd _hav_vacc_hist_ddd _hbv_vacc_hist_ddd _circum_ddd _hysterectomy_ddd&lt;BR /&gt;_family_hist_ddd _inhi_iti_his_ddd _inhi_immune_modulation_hist_ddd _joint_ble_hist_ddd _known_genetic_mutation_ddd&lt;BR /&gt;_cvad_ddd;&lt;BR /&gt;array dync(*) _ich_hist_te _hcv_hist_te _hbv_hist_te _hiv_hist_te _invas_joint_proc_hist_te _hav_vacc_hist_te _hbv_vacc_hist_te _circum_te _hysterectomy_te&lt;BR /&gt;_family_hist_te _inhi_iti_his_te _inhi_immune_modulation_hist_te _joint_ble_hist_te _known_genetic_mutation_te&lt;BR /&gt;_cvad_te;&lt;BR /&gt;array dynd(*) _ich_hist_ha _hcv_hist_ha _hbv_hist_ha _hiv_hist_ha _invas_joint_proc_hist_ha _hav_vacc_hist_ha _hbv_vacc_hist_ha _circum_ha _hysterectomy_ha&lt;BR /&gt;_family_hist_ha _inhi_iti_his_ha _inhi_immune_modulation_hist_ha _joint_ble_hist_ha _known_genetic_mutation_ha&lt;BR /&gt;_cvad_ha;&lt;BR /&gt;array dyne(*) _ich_hist_jk _hcv_hist_jk _hbv_hist_jk _hiv_hist_jk _invas_joint_proc_hist_jk _jkv_vacc_hist_jk _hbv_vacc_hist_jk _circum_jk _hysterectomy_jk&lt;BR /&gt;_family_hist_jk _inhi_iti_his_jk _inhi_immune_modulation_hist_jk _joint_ble_hist_jk _known_genetic_mutation_jk&lt;BR /&gt;_cvad_jk;&lt;BR /&gt;do i=1 to 15;&lt;BR /&gt;if dyn(i)= -9999 then dyne(i)=0.5; else dyne(i)=dyn(i);&lt;BR /&gt;if dyne(i)&amp;gt;dync(i) then do;&lt;BR /&gt;dynb(i)=dyn(i);&lt;BR /&gt;dynd(i)=dyn(i);&lt;BR /&gt;dync(i)=dyne(i);&lt;BR /&gt;end; else do; dynb(i)=dynd(i); end;&lt;BR /&gt;if last.subjectid_latest then do; call missing(dync(i), dynd(i));&lt;BR /&gt;end; end;&lt;BR /&gt;keep SubjectId_Latest _source _ich_hist _ich_hist_dyn _hcv_hist _hcv_hist_dyn _hiv_hist _hiv_hist_dyn&lt;BR /&gt;_invas_joint_proc_hist _invas_joint_proc_hist_dyn _hav_vacc_hist _hav_vacc_hist_dyn _hbv_vacc_hist&lt;BR /&gt;_hbv_vacc_hist_dyn _circum _circum_dyn _hysterectomy _hysterectomy_dyn _family_hist&lt;BR /&gt;_family_hist_dyn _inhi_iti_his _inhi_iti_his_dyn _inhi_immune_modulation_hist _inhi_immune_modulation_hist_dyn&lt;BR /&gt;_joint_ble_hist _joint_ble_hist_dyn;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 16:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760414#M240458</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T16:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760415#M240459</link>
      <description>Hi Jim,&lt;BR /&gt;I did not see your question: What is the explicit rule that makes the variable_want value for APJV74TMX and CRMGKSEZH stop being -9999 and switch to 1? Yes, stop being -9999 and switch to 1;&lt;BR /&gt;Best,&lt;BR /&gt;Le</description>
      <pubDate>Mon, 09 Aug 2021 16:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760415#M240459</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T16:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760418#M240460</link>
      <description>And Jim, only switch -9999 to 1 for all following year, not previous years. I got everything worked except this. Thanks so much for your help!</description>
      <pubDate>Mon, 09 Aug 2021 16:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760418#M240460</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T16:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760450#M240473</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;And Jim, only switch -9999 to 1 for all following year, not previous years. I got everything worked except this. Thanks so much for your help!&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Isn't that the behavior of the program now?&amp;nbsp; I must not be understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below, in which line numbers would the value of Variable_Want change?&amp;nbsp; And what value would Variable_Want change to?&lt;/P&gt;
&lt;DIV id="tinyMceEditorjimbarbour_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorjimbarbour_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_1-1628536666410.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62418i129D77D9C56B5E22/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_1-1628536666410.png" alt="jimbarbour_1-1628536666410.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorjimbarbour_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 19:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760450#M240473</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-09T19:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760468#M240477</link>
      <description>Hi Jim,&lt;BR /&gt;When I run the code, the line number 4, variable_want is still -9999, not 1 as shown in the table.&lt;BR /&gt;Also, the line 20 and 21. the variable_want=0, not . as shown in the table.&lt;BR /&gt;Did I do anything wrong?&lt;BR /&gt;Best,&lt;BR /&gt;Le</description>
      <pubDate>Mon, 09 Aug 2021 20:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760468#M240477</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T20:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760469#M240478</link>
      <description>The line 12, variable_want also =-9999, not 1 as shown.</description>
      <pubDate>Mon, 09 Aug 2021 20:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760469#M240478</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T20:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760471#M240479</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the difference between Line 4 and Line 12?&amp;nbsp; In Line 4 we want "1", but in Line 12, we want -9999.&amp;nbsp; Is it because for&amp;nbsp;X4T39JHGK there is additional data whereas for&amp;nbsp;APJV74TMX there is not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In other words, is this what you want?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628542814632.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62419i761B7FA9EE72DDF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1628542814632.png" alt="jimbarbour_0-1628542814632.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 21:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760471#M240479</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-09T21:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760478#M240481</link>
      <description>Hi Jim,&lt;BR /&gt;All I want variable_want=1 for all lines 4,12,19.&lt;BR /&gt;Best,&lt;BR /&gt;Le</description>
      <pubDate>Mon, 09 Aug 2021 21:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760478#M240481</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760480#M240482</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I want variable_want=1 for all lines 4,12,19.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;OK, so like this, yes?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628544869140.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62421i3B56BADBACF39380/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1628544869140.png" alt="jimbarbour_0-1628544869140.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The code I posted should already be doing this.&amp;nbsp; Is it not working for you?&amp;nbsp; If it is not working, did you change the program?&amp;nbsp; If so, I would need to see the actual code that you are running in order to help you.&amp;nbsp; I would also want to see the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the data you are running different?&amp;nbsp; If so, can you post the data here that is giving you the incorrect values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 21:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760480#M240482</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-09T21:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760489#M240486</link>
      <description>Hi Jim,&lt;BR /&gt;Here is my actual code:&lt;BR /&gt;data want;&lt;BR /&gt;set cc_iv_sv;&lt;BR /&gt;by SubjectId_Latest _date_of_visit NOTSORTED;&lt;BR /&gt;retain _ich_hist_te _hcv_hist_te _hbv_hist_te _hiv_hist_te _invas_joint_proc_hist_te _hav_vacc_hist_te _hbv_vacc_hist_te _circum_te _hysterectomy_te&lt;BR /&gt;_family_hist_te _inhi_iti_his_te _inhi_immune_modulation_hist_te _joint_ble_hist_te _known_genetic_mutation_te&lt;BR /&gt;_cvad_te;&lt;BR /&gt;retain _ich_hist_ha _hcv_hist_ha _hbv_hist_ha _hiv_hist_ha _invas_joint_proc_hist_ha _hav_vacc_hist_ha _hbv_vacc_hist_ha _circum_ha _hysterectomy_ha&lt;BR /&gt;_family_hist_ha _inhi_iti_his_ha _inhi_immune_modulation_hist_ha _joint_ble_hist_ha _known_genetic_mutation_ha&lt;BR /&gt;_cvad_ha;&lt;BR /&gt;array dyn(*) _ich_hist _hcv_hist _hbv_hist _hiv_hist _invas_joint_proc_hist _hav_vacc_hist _hbv_vacc_hist _circum _hysterectomy&lt;BR /&gt;_family_hist _inhi_iti_his _inhi_immune_modulation_hist _joint_ble_hist _known_genetic_mutation&lt;BR /&gt;_cvad;&lt;BR /&gt;array dynb(*) _ich_hist_ddd _hcv_hist_ddd _hbv_hist_ddd _hiv_hist_ddd _invas_joint_proc_hist_ddd _hav_vacc_hist_ddd _hbv_vacc_hist_ddd _circum_ddd _hysterectomy_ddd&lt;BR /&gt;_family_hist_ddd _inhi_iti_his_ddd _inhi_immune_modulation_hist_ddd _joint_ble_hist_ddd _known_genetic_mutation_ddd&lt;BR /&gt;_cvad_ddd;&lt;BR /&gt;array dync(*) _ich_hist_te _hcv_hist_te _hbv_hist_te _hiv_hist_te _invas_joint_proc_hist_te _hav_vacc_hist_te _hbv_vacc_hist_te _circum_te _hysterectomy_te&lt;BR /&gt;_family_hist_te _inhi_iti_his_te _inhi_immune_modulation_hist_te _joint_ble_hist_te _known_genetic_mutation_te&lt;BR /&gt;_cvad_te;&lt;BR /&gt;array dynd(*) _ich_hist_ha _hcv_hist_ha _hbv_hist_ha _hiv_hist_ha _invas_joint_proc_hist_ha _hav_vacc_hist_ha _hbv_vacc_hist_ha _circum_ha _hysterectomy_ha&lt;BR /&gt;_family_hist_ha _inhi_iti_his_ha _inhi_immune_modulation_hist_ha _joint_ble_hist_ha _known_genetic_mutation_ha&lt;BR /&gt;_cvad_ha;&lt;BR /&gt;array dyne(*) _ich_hist_jk _hcv_hist_jk _hbv_hist_jk _hiv_hist_jk _invas_joint_proc_hist_jk _jkv_vacc_hist_jk _hbv_vacc_hist_jk _circum_jk _hysterectomy_jk&lt;BR /&gt;_family_hist_jk _inhi_iti_his_jk _inhi_immune_modulation_hist_jk _joint_ble_hist_jk _known_genetic_mutation_jk&lt;BR /&gt;_cvad_jk;&lt;BR /&gt;do i=1 to 15;&lt;BR /&gt;if dyn(i)= -9999 then dyne(i)=0.5; else dyne(i)=dyn(i);&lt;BR /&gt;if dyne(i)&amp;gt;dync(i) then do;&lt;BR /&gt;dynb(i)=dyn(i);&lt;BR /&gt;dynd(i)=dyn(i);&lt;BR /&gt;dync(i)=dyne(i);&lt;BR /&gt;end; else do; dynb(i)=dynd(i); end;&lt;BR /&gt;if last.subjectid_latest then do; call missing(dync(i), dynd(i));&lt;BR /&gt;end; end;&lt;BR /&gt;keep SubjectId_Latest _source _ich_hist _ich_hist_dyn _hcv_hist _hcv_hist_dyn _hiv_hist _hiv_hist_dyn&lt;BR /&gt;_invas_joint_proc_hist _invas_joint_proc_hist_dyn _hav_vacc_hist _hav_vacc_hist_dyn _hbv_vacc_hist&lt;BR /&gt;_hbv_vacc_hist_dyn _circum _circum_dyn _hysterectomy _hysterectomy_dyn _family_hist&lt;BR /&gt;_family_hist_dyn _inhi_iti_his _inhi_iti_his_dyn _inhi_immune_modulation_hist _inhi_immune_modulation_hist_dyn&lt;BR /&gt;_joint_ble_hist _joint_ble_hist_dyn;&lt;BR /&gt;RUN;</description>
      <pubDate>Mon, 09 Aug 2021 22:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760489#M240486</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-09T22:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760493#M240488</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would it be possible for you to use the SAS code icon when you post your program?&amp;nbsp; It is very hard to read otherwise.&lt;/P&gt;
&lt;DIV id="tinyMceEditorjimbarbour_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_1-1628548641329.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62424i761B1A09EEEDE163/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_1-1628548641329.png" alt="jimbarbour_1-1628548641329.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760493#M240488</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-09T22:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760503#M240492</link>
      <description>&lt;P&gt;First:&amp;nbsp; Are all those versions of the array found in cc_iv_sv?&amp;nbsp; I suspect only Dyn is.&amp;nbsp; If so, it's probably best to define the other arrays as&amp;nbsp;&lt;SPAN&gt;_TEMPORARY_ and not give them individual field names.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Second:&amp;nbsp; I don't see anything wrong immediately.&amp;nbsp; I can't test it because of course I don't have access to cc_iv_sv.&amp;nbsp; The only thing I can recommend is that you use the Debug option of the Data step and follow the code as it executes.&amp;nbsp; If you have Enterprise Guide you would click on the little bug to enable debugging (if it is not already enabled).&amp;nbsp; You have to have at least EG 7.1.3 I think (maybe it's 7.1.5) in order to use the EG debugger.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628552462501.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62427i66F2E19CAEE05AFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1628552462501.png" alt="jimbarbour_0-1628552462501.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using Display Manager ("PC SAS"), then you would add &lt;FONT face="courier new,courier"&gt;/Debug&lt;/FONT&gt; as part of your Data statement like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want / debug;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you're using SAS Studio, it's going to be roughly similar to Enterprise Guide, but I don't have access to SAS Studio at the moment, so I can't give you any instruction there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not familiar with the debugger, you can just Google something like "SAS debugger commands" and you should be able to get started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I can't be of more assistance here, but I can't access cc_iv_sv, so there's not much more I can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 23:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760503#M240492</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-09T23:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760514#M240495</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392529"&gt;@binhle50&lt;/a&gt;&amp;nbsp;Below code addressing your initial question.&lt;/P&gt;
&lt;P&gt;Not sure what this array galore you've posted now is about but it appears you're now dealing with a totally different data structure. Please provide some sample data (via a SAS data step) and explain/show how the desired result needs to look like.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines dsd truncover;
  input id:$9. Year variable_have variable_want;
  datalines;
X4T39JHGK,2012,1,1
X4T39JHGK,2013,0,1
X4T39JHGK,2014, ,1
X4T39JHGK,2015,-9999,1
X4T39JHGK,2016,1,1
EZQA42HWD,2015,0,0
EZQA42HWD,2016,0,0
EZQA42HWD,2017,0,0
EZQA42HWD,2018,1,1
EZQA42HWD,2019,0,1
EZQA42HWD,2020, ,1
EZQA42HWD,2021,-9999,1
APJV74TMX,2015,-9999,-9999
APJV74TMX,2016,0,-9999
APJV74TMX,2017,0,-9999
APJV74TMX,2018,1,1
APJV74TMX,2019,0,1
APJV74TMX,2020, ,1
APJV74TMX,2021,-9999,1
CRMGKSEZH,2015, , 
CRMGKSEZH,2016, , 
CRMGKSEZH,2017,0,0
CRMGKSEZH,2018,-9999,-9999
CRMGKSEZH,2019,0,-9999
CRMGKSEZH,2020, ,-9999
CRMGKSEZH,2021,1,1
;

proc sort data=have;
  by id year;
run;

/* variable_derived: retain value based on value priority */
proc format;
  invalue value_prio
    1     =1
    -9999 =2
    0     =3
    other =4
  ;
run;

data want;
  set have;
  by id year;
  retain variable_derived;

  if first.id then
    variable_derived=variable_have;
  else if input(variable_have,value_prio.)&amp;lt;input(variable_derived,value_prio.) then
    variable_derived=variable_have;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Aug 2021 02:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760514#M240495</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-08-10T02:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760642#M240531</link>
      <description>Thanks so much Patrick, it is simple, straight forward but works great!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;Le</description>
      <pubDate>Tue, 10 Aug 2021 13:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760642#M240531</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-10T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode sequential values base on the previous value by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760647#M240532</link>
      <description>Hi Jim,&lt;BR /&gt;I can't thank you enough for taking your time to help me out. You are so helpful.&lt;BR /&gt;Also, that is my fault, the code that you sent did work perfectly. I run the code and checked it out, but I checked the wrong columns. This morning, I checked again and It works great.&lt;BR /&gt;Again, thanks a bunch!&lt;BR /&gt;Best,&lt;BR /&gt;Le</description>
      <pubDate>Tue, 10 Aug 2021 13:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-sequential-values-base-on-the-previous-value-by/m-p/760647#M240532</guid>
      <dc:creator>binhle50</dc:creator>
      <dc:date>2021-08-10T13:35:08Z</dc:date>
    </item>
  </channel>
</rss>

