<?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: track based on groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134624#M295567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my understanding&amp;nbsp; boin might want to count freq of the same route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for PGStats. just got how to input dd-mmm-yy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input LP_STATUS_ID $ UPDT_DT :anydtdte. CT_KEY;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 29-Dec-14 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 21-Jan-15 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Nov-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 14-Dec-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 4-Jan-14 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 5-Jul-13 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 21-Jul-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Feb-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Mar-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jun-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Nov-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Oct-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ST 4-Sep-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Aug-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jul-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have out=have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key updt_dt lp_status_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key updt_dt lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain _temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.ct_key then _temp=lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not first.ct_key and _temp ne lp_status_id then do; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lp=catx('_to_',_temp,lp_status_id);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _temp=lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=have1(where=(not missing(_lp))) noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables ct_key*_lp / out=have2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=have2 out=want(drop=_name_ _label_) prefix=Changed_from_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id _lp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jan 2015 03:41:06 GMT</pubDate>
    <dc:creator>szhao3</dc:creator>
    <dc:date>2015-01-23T03:41:06Z</dc:date>
    <item>
      <title>track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134622#M295565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the below :&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 196px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;LP_STATUS_ID&lt;/TD&gt;&lt;TD class="xl65" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="68"&gt;UPDT_DT&lt;/TD&gt;&lt;TD class="xl65" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;CT_KEY&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;VI&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;29-Dec-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;21-Jan-15&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CR&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Nov-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;14-Dec-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;LP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Jan-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5-Jul-13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;LP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;21-Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CR&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Feb-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Mar-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;VI&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Jun-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Nov-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CR&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Oct-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;ST&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;NOLP&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Aug-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;VI&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4-Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; am trying to get the output table as below&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 365px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;CT_KEY&lt;/TD&gt;&lt;TD class="xl65" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="146"&gt;Changed&lt;BR /&gt;&amp;nbsp; fromVi-NoLP&lt;/TD&gt;&lt;TD class="xl65" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="155"&gt;Changed from CR-NOLP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Tried several ways&amp;nbsp; like first and last based on dates but no luck, any help would be great ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 01:56:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134622#M295565</guid>
      <dc:creator>boin</dc:creator>
      <dc:date>2015-01-23T01:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134623#M295566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood what you want :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input LP_STATUS_ID $ UPDT_DT :anydtdte. CT_KEY;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 29-Dec-14 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 21-Jan-15 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Nov-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 14-Dec-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 4-Jan-14 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 5-Jul-13 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 21-Jul-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Feb-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Mar-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jun-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Nov-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Oct-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ST 4-Sep-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Aug-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jul-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data temp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length from_status $8 status_change_var $16 status_change_label $20 dummy $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dummy = "1";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do until (last.ct_key);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have; by ct_key;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status_change_var = catx("_", from_status, LP_status_id);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status_change_label = catx(" ", "Changed from", catx("-", from_status, LP_status_id)); &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not first.ct_key then output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from_status = lp_status_id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep ct_key status_change_var status_change_label dummy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=temp out=want(drop=_:);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by ct_key;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var dummy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;id status_change_var;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;idlabel status_change_label;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 03:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134623#M295566</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-23T03:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134624#M295567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my understanding&amp;nbsp; boin might want to count freq of the same route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for PGStats. just got how to input dd-mmm-yy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input LP_STATUS_ID $ UPDT_DT :anydtdte. CT_KEY;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 29-Dec-14 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 21-Jan-15 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Nov-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 14-Dec-14 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 4-Jan-14 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 5-Jul-13 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LP 21-Jul-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Feb-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Mar-14 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jun-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Nov-14 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CR 4-Oct-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ST 4-Sep-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOLP 4-Aug-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VI 4-Jul-14 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have out=have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key updt_dt lp_status_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key updt_dt lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain _temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.ct_key then _temp=lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not first.ct_key and _temp ne lp_status_id then do; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lp=catx('_to_',_temp,lp_status_id);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _temp=lp_status_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=have1(where=(not missing(_lp))) noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables ct_key*_lp / out=have2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=have2 out=want(drop=_name_ _label_) prefix=Changed_from_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id _lp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by ct_key;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 03:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134624#M295567</guid>
      <dc:creator>szhao3</dc:creator>
      <dc:date>2015-01-23T03:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134625#M295568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still hard to catch you .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data have;
input LP_STATUS_ID $ UPDT_DT :anydtdte. CT_KEY;
datalines;
VI 29-Dec-14 1
NOLP 21-Jan-15 1
CR 4-Nov-14 2
NOLP 14-Dec-14 2
LP 4-Jan-14 4
NOLP 5-Jul-13 4
LP 21-Jul-14 5
CR 4-Feb-14 5
NOLP 4-Mar-14 5
VI 4-Jun-14 6
NOLP 4-Nov-14 6
CR 4-Oct-14 7
ST 4-Sep-14 7
NOLP 4-Aug-14 7
VI 4-Jul-14 7
;
data temp;
 set have;
 by&amp;nbsp; CT_KEY ;
 length text $ 100;
 retain text ;
 retain var 1;
 text=catx('_',text,LP_STATUS_ID);
 if last.CT_KEY then do;output;call missing(text);end;
 keep&amp;nbsp; CT_KEY var text;
run;
proc transpose data=temp out=want(drop=_:) ;
by CT_KEY;
var var;
id text;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 06:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134625#M295568</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-23T06:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134626#M295569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, for CT_KEY=7, you summarized change CR_ST_NOLP_VI and I counted each individual change CR_ST ST_NOLP NOLP_VI.&lt;/P&gt;&lt;P&gt;If there were repeated change, its frequency would gt 1 as the following modified data shows.&amp;nbsp; Anyway i am not sure &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;what boin asked for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input LP_STATUS_ID $ UPDT_DT :anydtdte. CT_KEY;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;VI 29-Dec-14 1&lt;/P&gt;&lt;P&gt;NOLP 21-Jan-15 1&lt;/P&gt;&lt;P&gt;CR 4-Nov-14 2&lt;/P&gt;&lt;P&gt;NOLP 14-Dec-14 2&lt;/P&gt;&lt;P&gt;LP 4-Jan-14 4&lt;/P&gt;&lt;P&gt;NOLP 5-Jul-13 4&lt;/P&gt;&lt;P&gt;LP 21-Jul-14 5&lt;/P&gt;&lt;P&gt;CR 4-Feb-14 5&lt;/P&gt;&lt;P&gt;NOLP 4-Mar-14 5&lt;/P&gt;&lt;P&gt;VI 4-Jun-14 6&lt;/P&gt;&lt;P&gt;NOLP 4-Nov-14 6&lt;/P&gt;&lt;P&gt;CR 4-Oct-14 7&lt;/P&gt;&lt;P&gt;ST 4-Sep-14 7&lt;/P&gt;&lt;P&gt;CR 6-Oct-14 7&lt;/P&gt;&lt;P&gt;ST 5-Oct-14 7&lt;/P&gt;&lt;P&gt;NOLP 4-Aug-14 7&lt;/P&gt;&lt;P&gt;VI 4-Jul-14 7&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 14:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134626#M295569</guid>
      <dc:creator>szhao3</dc:creator>
      <dc:date>2015-01-23T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: track based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134627#M295570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the reason why I am not able to catch on OP .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2015 06:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/track-based-on-groups/m-p/134627#M295570</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-24T06:59:59Z</dc:date>
    </item>
  </channel>
</rss>

