<?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: Transpose and keep another variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/241139#M55671</link>
    <description>&lt;P&gt;data have;&lt;BR /&gt;informat encdate1 otherdate1 mmddyy10.;&lt;BR /&gt;format encdate1 otherdate1 mmddyy10.;&lt;BR /&gt;infile cards;&lt;BR /&gt;input patssn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encdate1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherDate1;&lt;BR /&gt;cards;&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/12/13&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/14/13&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/15/14&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/12/14&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/22/13&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/1/13&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by patssn diag encdate1;&lt;BR /&gt;if 90 &amp;lt;= (otherdate1 - encdate1) &amp;lt;= 120 then count + 1;&lt;BR /&gt;if first.encdate1 then count = 1;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2015 16:45:33 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-12-29T16:45:33Z</dc:date>
    <item>
      <title>Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240506#M55608</link>
      <description>&lt;P&gt;I have a long data set that contains an id (patssn), diagnosis code (diag), encounter date (encdate1), and a second date (otherDate1). There are many records containing the same id, diag, and encdate with a different otherDate1. I eventually need to&amp;nbsp;count&amp;nbsp;the number of otherDate1's&amp;nbsp;a person had with the same diagnosis between 90 and 180 days after the encdate1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently the data is structured like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;patssn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encdate1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherDate1&lt;/P&gt;&lt;P&gt;1&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;3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/12/13&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/14/13&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1/15/14&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/12/14&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp;11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/22/13&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp;11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/1/13&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following code, I was able to transpose the data, but don't get the encdate1, and I need the encdate1 in order to determine the date from which to start counting the number of otherDate1's 90-180 days after the encdate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;transpose&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=diag3_sort &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=caper_transpose2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;prefix&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=diag;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; patssn;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; otherDate1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;The transposed data looks like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;patssn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ameofformervariable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag5....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;123456789&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherDate1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;10/12/13&amp;nbsp;&amp;nbsp;&amp;nbsp;11/14/13&amp;nbsp;&amp;nbsp;1/15/14&amp;nbsp;&amp;nbsp; 2/12/14&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;234567890&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherDate1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;11/22/13&amp;nbsp;&amp;nbsp; 12/13/13&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;I believe I need to transpose the data and&amp;nbsp;in another step&amp;nbsp;have SAS count the number of otherDiag1 at least 90 days but less than 181 days after encdate1. If I'm correct, how do I keep encdate1 (which is the same) for every patssn?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240506#M55608</guid>
      <dc:creator>janet0102</dc:creator>
      <dc:date>2015-12-22T18:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240509#M55609</link>
      <description>&lt;P&gt;Why not just add encdate1 to the BY variable(s)?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240509#M55609</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-12-22T18:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240516#M55613</link>
      <description>&lt;P&gt;I had tried adding encdate1 to the by variable. I got the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Data set WORK.DIAG3_SORT is not sorted in ascending sequence. The current BY group has&lt;/P&gt;&lt;P&gt;encdate1 = 10/29/2013 and the next BY group has encdate1 = 10/03/2013.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240516#M55613</guid>
      <dc:creator>janet0102</dc:creator>
      <dc:date>2015-12-22T18:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240518#M55614</link>
      <description>You would have to sort by the date as well....&lt;BR /&gt;Sort your data with the same BY you use in the proc transpose.</description>
      <pubDate>Tue, 22 Dec 2015 18:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240518#M55614</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-22T18:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240521#M55615</link>
      <description>&lt;P&gt;I should have said the data has been sorted by patssn and otherDate1. The data set diag3_sort lists the patssn in order and within the patssn, the otherDate1 variable is in order. Encdate1 is the same for every row containing the same patssn.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240521#M55615</guid>
      <dc:creator>janet0102</dc:creator>
      <dc:date>2015-12-22T18:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240524#M55617</link>
      <description>Your example data is inadequate.</description>
      <pubDate>Tue, 22 Dec 2015 19:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240524#M55617</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-12-22T19:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240529#M55620</link>
      <description>&lt;P&gt;I'm attaching an Excel file with the data for 20 individuals found in my SAS file. (My SAS file uses actual ssns, and therefore, I can't attach it.) The variable nbDiag is the number of encounters the individual has with the diagnosis code (diag) noted. Encdate1 is the first encounter with the specific diag; there are nbDiag - 1 rows for that patssn and diag. However, that same patssn can be listed with more than one diag (see individual #16).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I transpose the data, I have 76 variables: patssn, nameofformer variable, and diag1-diag74; there's one row for every patssn/diag combination. I also need encdate1 associated with the specific individual and diag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240529#M55620</guid>
      <dc:creator>janet0102</dc:creator>
      <dc:date>2015-12-22T20:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240555#M55622</link>
      <description>&lt;P&gt;If all you need to do is count number of diags you don't need to transpose. See if following works. Data will need to be sorted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
input patssn diag encdate1 mmddyy8. otherDate1 mmddyy8.;
format encdate1 otherDate1 mmddyy8.;
datalines;
1 3051  10/1/13 10/12/13
1 3051  10/1/13 11/14/13
1 3051  10/1/13 1/15/14
1 3051  10/1/13 2/12/14
2 33829 11/15/13 11/22/13
2 33829 11/15/13 12/1/13
;
run;

data x1;
	set x;
	by patssn diag encdate1 otherDate1;
	retain count;
	if first.encdate1 then count=0;
	if 90&amp;lt;=otherDate1-encdate1+1&amp;lt;=180 then count=count+1;
	if last.encdate1;
	keep patssn diag encdate1 count;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Dec 2015 21:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240555#M55622</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-12-22T21:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240588#M55623</link>
      <description>&lt;P&gt;You didn't post the output you want yet .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
input patssn diag encdate1 mmddyy8. otherDate1 mmddyy8.;
format encdate1 otherDate1 mmddyy8.;
datalines;
1 3051  10/1/13 10/12/13
1 3051  10/1/13 11/14/13
1 3051  10/1/13 1/15/14
1 3051  10/1/13 2/12/14
2 33829 11/15/13 11/22/13
2 33829 11/15/13 12/1/13
;
run;

proc sql;
create table want as
 select a.*,
  (select count(*) from x 
    where a.patssn=patssn and a.diag=diag and a.encdate1=encdate1 
    and otherDate1 between a.encdate1+90 and a.encdate1+180) as count
  from x as a ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Dec 2015 02:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/240588#M55623</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-23T02:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and keep another variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/241139#M55671</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;informat encdate1 otherdate1 mmddyy10.;&lt;BR /&gt;format encdate1 otherdate1 mmddyy10.;&lt;BR /&gt;infile cards;&lt;BR /&gt;input patssn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diag&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encdate1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherDate1;&lt;BR /&gt;cards;&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/12/13&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/14/13&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/15/14&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/1/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/12/14&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/22/13&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33829&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/15/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/1/13&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by patssn diag encdate1;&lt;BR /&gt;if 90 &amp;lt;= (otherdate1 - encdate1) &amp;lt;= 120 then count + 1;&lt;BR /&gt;if first.encdate1 then count = 1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 16:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transpose-and-keep-another-variable/m-p/241139#M55671</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-12-29T16:45:33Z</dc:date>
    </item>
  </channel>
</rss>

