<?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: Number of months it takes to return to the previous state after a first exit in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686597#M208389</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My ultimate goal is to find whether an individual returned to ES after he/she 1st exited from various types of programs and how long did it take to get to ES.&lt;/P&gt;
&lt;P&gt;Both of your suggested solution calculate how long does it take for an individual to get to ES from 1st ES exit, &lt;EM&gt;&lt;STRONG&gt;how long does it take to get to TH from 1st TH exit.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you actually look at the results of my program?&amp;nbsp; It calculates two new variables: NES &lt;EM&gt;&lt;STRONG&gt;and NTH&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; NTH is precisely how long it takes to get to TH from 1st TH exit.&amp;nbsp; There are 8 statements that calclulate NES, and (after resetting the utility variables to missing, in preparation for re-use) a similar set of 8 statements calculating NTH.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 02:37:27 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2020-09-25T02:37:27Z</dc:date>
    <item>
      <title>Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686177#M208173</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to calculate a number of months it takes a person to get back to the previous program from his/her first exit from the program.&lt;/P&gt;
&lt;P&gt;In the attached sample data, I have listed two program types and individuals' status for 10 months (in the real data, I have many programs and almost 5 years of data). Two variables in the last columns (NumofMonthtoES from 1st ES exit and NumofMonthtoES from 1st&amp;nbsp;TH exit) are my desired variables. I want to know the Number of months it takes a person to get to ES from first ES/TH exits.&lt;/P&gt;
&lt;P&gt;I would truly appreciate the help!&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 19:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686177#M208173</guid>
      <dc:creator>HarryB</dc:creator>
      <dc:date>2020-09-23T19:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686253#M208203</link>
      <description>&lt;P&gt;This looks like array processing would be a good approach.&amp;nbsp; Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME	Returns	XLSX	'.\SampleData\SampleData.xlsx';

DATA	Want;
	DROP	_:;
	SET	Returns.ES_TH;
	ARRAY	ES_Array	[*]	ES1 - ES10;
	ARRAY	TH_Array	[*]	TH1 - TH10;

	_ES_Cnt								=	0;
	_ES_True							=	0;
	DO	_i								=	1	TO	DIM(ES_Array);
		IF	ES_Array[_i]				=	0	AND
			_ES_True							THEN
			DO;
				_ES_Cnt					+	1;
			END;
		ELSE
		IF	ES_Array[_i]				=	1	THEN
			IF	_ES_Cnt					&amp;gt;=	1	THEN
				DO;
					Num_Months_ES		=	_ES_Cnt;
					_i					=	DIM(ES_Array);
				END;
			ELSE
				DO;
					_ES_True			=	1;
				END;
	END;

	_TH_Cnt								=	0;
	_TH_True							=	0;
	DO	_i								=	1	TO	DIM(TH_Array);
		IF	TH_Array[_i]				=	0	AND
			_TH_True							THEN
			DO;
				_TH_Cnt					+	1;
			END;
		ELSE
		IF	TH_Array[_i]				=	1	THEN
			IF	_TH_Cnt					&amp;gt;=	1	THEN
				DO;
					Num_Months_TH		=	_TH_Cnt;
					_i					=	DIM(TH_Array);
				END;
		ELSE
			DO;
				_TH_True				=	1;
			END;
	END;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which would give you the following results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1600908433754.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49731i076471B9452DD1E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1600908433754.png" alt="jimbarbour_0-1600908433754.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe you have a bit of an error in your sample results.&amp;nbsp; I think the 4th TH should be "1" not "2", yes?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_1-1600908560321.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49732iDF304BB2C57137AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_1-1600908560321.png" alt="jimbarbour_1-1600908560321.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that the sort of thing that you were looking for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 00:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686253#M208203</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-24T00:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686274#M208206</link>
      <description>&lt;P&gt;Edit:&amp;nbsp; Now that I understand that the second value (NTH here) is the number of months from quitting TH to restarting ES, I've corrected the code below.&amp;nbsp; It's trivial:&amp;nbsp; just change one reference&amp;nbsp; (in the second&amp;nbsp;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;CODE class=" language-sas"&gt;  if (_firstone&amp;lt;_quit&amp;lt;10) then do ...&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;statement to refer to the XES array instead of the XTH array.&amp;nbsp; It's marked with an "** edit here**;" comment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree that arrays are the way to structure this problem.&amp;nbsp; But I think you can take advantage of the DO ... UNTIL syntax to make the code simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conceptual logic is&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;default number of months to zero.&lt;/LI&gt;
&lt;LI&gt;Find the first 1&amp;nbsp; (via the whichn function), since you can't quit (encounter a 0) until after there is a 1.&lt;/LI&gt;
&lt;LI&gt;If the first 1 (variable _firstone) lies between 1 and 8 (for this size array), then there is room to quit and restart, so look for a quit between the first 1 and array element 9.&lt;/LI&gt;
&lt;LI&gt;If there is such a quit (variable _quit), then look for a restart (the next 1).&lt;/LI&gt;
&lt;LI&gt;If there is no value of 1 after the quit element, then the _restart variable is 11, so leave the default number of months at zero, otherwise subtract _quit from _restart:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input id es1-es10 th1-th10;
datalines;
1   	1	1	0	0	0	0	1	1	0	0		1	1	1	0	0	0	1	1	0	0
2   	0	0	1	1	0	0	0	0	1	1		0	0	1	1	1	0	0	0	1	1
3   	0	0	1	1	1	0	0	0	1	0		0	0	1	1	1	1	1	0	1	0
4   	1	1	0	0	1	1	0	0	1	1		1	1	0	1	1	1	0	0	1	1
5   	0	0	0	0	1	1	1	1	1	0		0	0	0	1	1	1	1	1	1	0
6   	0	0	1	1	1	1	0	0	0	0		0	0	1	1	1	1	1	0	0	0
7   	1	1	1	1	0	1	0	0	0	0		1	1	1	1	0	1	1	0	0	0
8   	0	0	0	1	1	0	0	0	0	1		0	0	0	1	1	1	0	0	0	1
run;

data want (drop=_:);
  set have;

  array xes {*} es: ;
  nes=0;
  _firstone=whichn(1,of xes{*});
  if (1&amp;lt;=_firstone&amp;lt;=8) then do _quit=_firstone+1 to 9 until (xes{_quit}=0);
  end;
  if (_firstone&amp;lt;_quit&amp;lt;10) then do _restart=_quit+1 to 10 until(xes{_restart}=1);
  end;
  if (_quit&amp;lt;_restart&amp;lt;=10) then nes=_restart-_quit;

  call missing(of _:);
  array xth {*} th: ;
  nth=0;
  _firstone=whichn(1,of xth{*});
  if (1&amp;lt;=_firstone&amp;lt;=8) then do _quit=_firstone+1 to 9 until (xth{_quit}=0);
  end;  
  if (_firstone&amp;lt;_quit&amp;lt;10) then do _restart=_quit+1 to 10 &lt;FONT color="#000000"&gt;until(xes{_restart}=1);&lt;/FONT&gt;  **Edit here **;
  end;
  if (_quit&amp;lt;_restart&amp;lt;=10) then nth=_restart-_quit;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works for array of exactly size 10.&amp;nbsp; If you want to generalize, then you can use DIM(x) instead of 10, DIM(x)-1 instead of 9, DIM(x)-2 instead of 8, where x is the array name:&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;

  array xes {*} es: ;
  nes=0;
  _firstone=whichn(1,of xes{*});
  if (1&amp;lt;=_firstone&amp;lt;=dim(xes)-2) then do _quit=_firstone+1 to dim(xes)-1 until (xes{_quit}=0);
  end;
  if (_firstone&amp;lt;_quit&amp;lt;dim(xes)) then do _restart=_quit+1 to dim(xes) until(xes{_restart}=1);
  end;
  if (_quit&amp;lt;_restart&amp;lt;=dim(xes)) then nes=_restart-_quit;

  call missing(of _:);
  array xth {*} th: ;
  nth=0;
  _firstone=whichn(1,of xth{*});
  if (1&amp;lt;=_firstone&amp;lt;=dim(xth)-2) then do _quit=_firstone+1 to dim(xth)-1 until (xth{_quit}=0);
  end;
  if (_firstone&amp;lt;_quit&amp;lt;dim(xth)) then do _restart=_quit+1 to dim(xth) until(&lt;FONT color="#000000"&gt;xes&lt;/FONT&gt;{_restart}=1);  ** Edit here**;
  end;
  if (_quit&amp;lt;_restart&amp;lt;=dim(xth)) then nth=_restart-_quit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The "trick" here is the DO UNTIL construct.&amp;nbsp; Once the until-condition is met, then the loop index is not incremented, and points directly to the array element of interest (_quit or _restart).&amp;nbsp; If it is never met then the index is 1 greater than the loop upper limit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Editted note:&amp;nbsp; I guess the other point to make here is that the expression&amp;nbsp;&amp;nbsp; (x&amp;lt;y&amp;lt;z) is a logical expression equivalent to (x&amp;lt;y and y&amp;lt;z).&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 04:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686274#M208206</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-25T04:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686375#M208262</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the prompt response. Both of your suggestions seem to work; however, there may be a confusion on my question.&lt;/P&gt;
&lt;P&gt;I want to know how long does it take for an individual to get to ES from 1st ES exit, from 1st TH exit, and so on.&lt;/P&gt;
&lt;P&gt;My ultimate goal is to find whether an individual returned to ES after he/she 1st exited from various types of programs and how long did it take to get to ES.&lt;/P&gt;
&lt;P&gt;Both of your suggested solution calculate how long does it take for an individual to get to ES from 1st ES exit, how long does it take to get to TH from 1st TH exit.&lt;/P&gt;
&lt;P&gt;I hope this is more clear than the previous post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again for your help !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 13:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686375#M208262</guid>
      <dc:creator>HarryB</dc:creator>
      <dc:date>2020-09-24T13:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686383#M208265</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh. dear.&amp;nbsp; I am completely lost.&amp;nbsp; I don't understand.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you give me a couple examples?&amp;nbsp; Perhaps you could walk me through step by step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 14:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686383#M208265</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-24T14:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686400#M208272</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Sorry, I should have explained it in detail.&lt;/P&gt;
&lt;P&gt;Let's see a couple of IDs.&lt;/P&gt;
&lt;P&gt;ID 4:&lt;/P&gt;
&lt;P&gt;This individual first exited from the ES program at the month of 2 and re-entered at the month of 5, which means it took 2 months to get back to ES.&lt;/P&gt;
&lt;P&gt;The same individual&amp;nbsp;also happen to be&amp;nbsp;in the TH program. This individual exited the TH program at the month of 2 (happen to be the same as ES 1st exit, but it could have been any number) and entered into ES at the month of 5, which means it took 2 months to get to ES after he/she 1st exited from the TH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID 8:&lt;/P&gt;
&lt;P&gt;First exited from the ES at the month of 5 and re-entered at the month of 10, so took 4 months go get back to ES.&lt;/P&gt;
&lt;P&gt;First exited from the TH at the month of 6 and entered to ES at the month of 10, so took 3 months to get to ES.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bottom line is I want to know did they get back to ES once they first exited from ES, TH, and so on. If they entered into ES from 1st ES exit, 1st TH exit and so on, how long did it take for them to get to ES.&lt;/P&gt;
&lt;P&gt;I hope this is helpful.&lt;/P&gt;
&lt;P&gt;Thank you for taking your precious time and responding to my question.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 15:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686400#M208272</guid>
      <dc:creator>HarryB</dc:creator>
      <dc:date>2020-09-24T15:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686592#M208384</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to take so long to reply.&amp;nbsp; It's been a long day at work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OK!&amp;nbsp; That explanation makes sense.&amp;nbsp; I think I get it now.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what I've come up with in terms of SAS code, and the results are below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME	Returns	XLSX	'.\SampleData\SampleData.xlsx';

DATA	Want;
	DROP	_:;
	SET	Returns.ES_TH;
	ARRAY	ES_Array	[*]	ES1 - ES10;
	ARRAY	TH_Array	[*]	TH1 - TH10;

	_ES_Cnt								=	0;
	_ES_True							=	0;
	_ES_Done							=	0;
	_TH_Cnt								=	0;
	_TH_True							=	0;
	_TH_Done							=	0;
	_TH_Zero							=	0;

	DO	_i								=	1	TO	DIM(ES_Array);
		IF	TH_Array[_i]				=	1	THEN
			DO;
				_TH_True				=	1;
			END;
		ELSE
			DO;
				IF	_TH_True					THEN
					_TH_Zero			=	1;
			END;

		IF	ES_Array[_i]				=	0	THEN
			DO;
				IF	_ES_True					AND
					NOT	_ES_Done				THEN
					DO;
						_ES_Cnt			+	1;
					END;

				IF	_TH_True					AND
					_TH_Zero					AND
					NOT	_TH_Done				THEN
					DO;
						_TH_Cnt			+	1;
					END;
			END;
		ELSE
		IF	ES_Array[_i]				=	1	THEN
			DO;
				IF	_ES_Cnt				&amp;gt;=	1	AND
					NOT	_ES_Done				THEN
					DO;
						Num_Months_ES	=	_ES_Cnt;
						_ES_Done		=	1;
					END;
				ELSE
					DO;
						_ES_True		=	1;
					END;

				IF	_TH_Cnt				&amp;gt;=	1	AND
					NOT	_TH_Done				THEN
					DO;
						Num_Months_TH	=	_TH_Cnt;
						_TH_Done		=	1;
					END;
			END;

		IF	_ES_Done							AND
			_TH_Done							THEN
			_i							=	DIM(ES_Array);
	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-1600999588310.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49766iEEC4899F8C6FAF52/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1600999588310.png" alt="jimbarbour_0-1600999588310.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 02:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686592#M208384</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-25T02:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686597#M208389</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My ultimate goal is to find whether an individual returned to ES after he/she 1st exited from various types of programs and how long did it take to get to ES.&lt;/P&gt;
&lt;P&gt;Both of your suggested solution calculate how long does it take for an individual to get to ES from 1st ES exit, &lt;EM&gt;&lt;STRONG&gt;how long does it take to get to TH from 1st TH exit.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you actually look at the results of my program?&amp;nbsp; It calculates two new variables: NES &lt;EM&gt;&lt;STRONG&gt;and NTH&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; NTH is precisely how long it takes to get to TH from 1st TH exit.&amp;nbsp; There are 8 statements that calclulate NES, and (after resetting the utility variables to missing, in preparation for re-use) a similar set of 8 statements calculating NTH.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 02:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686597#M208389</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-25T02:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686605#M208396</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;NTH is precisely how long it takes to get to TH from 1st TH exit.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe you are correct. I thought&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;&amp;nbsp;wanted that too, but he clarified that what he wants is&amp;nbsp;how long it takes to get to &lt;STRIKE&gt;TH&lt;/STRIKE&gt; &lt;STRONG&gt;ES&lt;/STRONG&gt; from 1st TH exit.&amp;nbsp; All counts should be incremented until &lt;STRONG&gt;ES&lt;/STRONG&gt; resumes.&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;</description>
      <pubDate>Fri, 25 Sep 2020 04:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686605#M208396</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-25T04:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686607#M208398</link>
      <description>&lt;P&gt;Ah.&amp;nbsp; thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt; .&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 04:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/686607#M208398</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-25T04:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687004#M208535</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18"&gt;@Harry&lt;/a&gt;&lt;BR /&gt;Was my last answer satisfactory?  If so, please mark solved otherwise please feel free to ask further questions.&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Sep 2020 04:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687004#M208535</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-27T04:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687057#M208562</link>
      <description>Wrong Harry J&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Sep 2020 19:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687057#M208562</guid>
      <dc:creator>Harry</dc:creator>
      <dc:date>2020-09-27T19:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687058#M208563</link>
      <description>&lt;P&gt;Whoops, sorry&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18"&gt;@Harry&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269561"&gt;@HarryB&lt;/a&gt;, how are we doing here? &amp;nbsp;Was my last post a reasonable solution? &amp;nbsp;Or do we still need some more work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 19:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687058#M208563</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-27T19:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687655#M208774</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, it took me a while to come back to this. Your updated solution perfectly works on my dataset. I truly appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687655#M208774</guid>
      <dc:creator>HarryB</dc:creator>
      <dc:date>2020-09-29T20:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months it takes to return to the previous state after a first exit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687667#M208776</link>
      <description>&lt;P&gt;Excellent.&amp;nbsp; Glad I was able to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-it-takes-to-return-to-the-previous-state-after/m-p/687667#M208776</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-29T22:03:03Z</dc:date>
    </item>
  </channel>
</rss>

