<?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 Find change of drug and add incremental line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-change-of-drug-and-add-incremental-line/m-p/830470#M328157</link>
    <description>&lt;P&gt;ID start_date new_end_Date drug drug_1 drug_2 Need&lt;BR /&gt;x1 36526 36708 t t 1&lt;BR /&gt;x1 39448 40086 l l 2&lt;BR /&gt;x1 40087 40421 a,l a l 3&lt;BR /&gt;x1 40422 41890 a a 3&lt;BR /&gt;x1 41891 42453 l l 3&lt;BR /&gt;x1 42454 43698 c,l c l 4&lt;BR /&gt;x1 43699 44026 l l 4&lt;BR /&gt;x1 44027 44304 l,r l r 5&lt;BR /&gt;x1 44305 44474 r r 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to create a column if there is true change of drug(Column 'need'). Drug_1 and drug_2 is nothing but 'drug' separated into different columns.&lt;/P&gt;&lt;P&gt;What is needed (NEED Column above):&lt;/P&gt;&lt;P&gt;1) first row - the drug is t and first drug so column need should have value of 1&lt;/P&gt;&lt;P&gt;2) Second row - the drug is l (so drug changed from t to l) - column value should be 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) third row - the drug is a,l (even though drug l from second row exists here but new drug 'a' is added) - column value should be 3&lt;/P&gt;&lt;P&gt;4) Fourth row - drug is 'a' (previous row drug 'a' exists is here, not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;5) Fifth row - drug is l (fourth row drug 'a' doesn't exists is here, but third row have a,l (a,l changed to a and then to l so continued)&amp;nbsp; -&amp;nbsp; not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6)&amp;nbsp;sixth row - drug is c,l&amp;nbsp; (3,4,5 rows have&amp;nbsp; a,l &amp;amp; a &amp;amp; l -&amp;nbsp; but c is added) - column value should be 4.&lt;/P&gt;&lt;P&gt;7)&amp;nbsp;seventh row - drug is l&amp;nbsp; (6 row had c,l&amp;nbsp; and this row had l so no change) - column value should be 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&amp;nbsp;eighth row - drug is l,r&amp;nbsp; (6 row had c,l and 7row had l - but r is added here ) - column value should be 5&lt;/P&gt;&lt;P&gt;9) ninth row -&amp;nbsp;drug is r&amp;nbsp; (8 row had l,r and this row had r so no change ) - column value should be 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is tricky, sorry if my question is not clear. Appreciate any help. Thank you All.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 03:05:51 GMT</pubDate>
    <dc:creator>nkp</dc:creator>
    <dc:date>2022-08-26T03:05:51Z</dc:date>
    <item>
      <title>Find change of drug and add incremental line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-change-of-drug-and-add-incremental-line/m-p/830470#M328157</link>
      <description>&lt;P&gt;ID start_date new_end_Date drug drug_1 drug_2 Need&lt;BR /&gt;x1 36526 36708 t t 1&lt;BR /&gt;x1 39448 40086 l l 2&lt;BR /&gt;x1 40087 40421 a,l a l 3&lt;BR /&gt;x1 40422 41890 a a 3&lt;BR /&gt;x1 41891 42453 l l 3&lt;BR /&gt;x1 42454 43698 c,l c l 4&lt;BR /&gt;x1 43699 44026 l l 4&lt;BR /&gt;x1 44027 44304 l,r l r 5&lt;BR /&gt;x1 44305 44474 r r 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to create a column if there is true change of drug(Column 'need'). Drug_1 and drug_2 is nothing but 'drug' separated into different columns.&lt;/P&gt;&lt;P&gt;What is needed (NEED Column above):&lt;/P&gt;&lt;P&gt;1) first row - the drug is t and first drug so column need should have value of 1&lt;/P&gt;&lt;P&gt;2) Second row - the drug is l (so drug changed from t to l) - column value should be 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) third row - the drug is a,l (even though drug l from second row exists here but new drug 'a' is added) - column value should be 3&lt;/P&gt;&lt;P&gt;4) Fourth row - drug is 'a' (previous row drug 'a' exists is here, not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;5) Fifth row - drug is l (fourth row drug 'a' doesn't exists is here, but third row have a,l (a,l changed to a and then to l so continued)&amp;nbsp; -&amp;nbsp; not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6)&amp;nbsp;sixth row - drug is c,l&amp;nbsp; (3,4,5 rows have&amp;nbsp; a,l &amp;amp; a &amp;amp; l -&amp;nbsp; but c is added) - column value should be 4.&lt;/P&gt;&lt;P&gt;7)&amp;nbsp;seventh row - drug is l&amp;nbsp; (6 row had c,l&amp;nbsp; and this row had l so no change) - column value should be 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&amp;nbsp;eighth row - drug is l,r&amp;nbsp; (6 row had c,l and 7row had l - but r is added here ) - column value should be 5&lt;/P&gt;&lt;P&gt;9) ninth row -&amp;nbsp;drug is r&amp;nbsp; (8 row had l,r and this row had r so no change ) - column value should be 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is tricky, sorry if my question is not clear. Appreciate any help. Thank you All.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 03:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-change-of-drug-and-add-incremental-line/m-p/830470#M328157</guid>
      <dc:creator>nkp</dc:creator>
      <dc:date>2022-08-26T03:05:51Z</dc:date>
    </item>
    <item>
      <title>change of drug increment the value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-change-of-drug-and-add-incremental-line/m-p/830479#M328278</link>
      <description>&lt;P&gt;ID start_date new_end_Date drug drug_1 drug_2 Need&lt;BR /&gt;x1 36526 36708 t t 1&lt;BR /&gt;x1 39448 40086 l l 2&lt;BR /&gt;x1 40087 40421 a,l a l 3&lt;BR /&gt;x1 40422 41890 a a 3&lt;BR /&gt;x1 41891 42453 l l 3&lt;BR /&gt;x1 42454 43698 c,l c l 4&lt;BR /&gt;x1 43699 44026 l l 4&lt;BR /&gt;x1 44027 44304 l,r l r 5&lt;BR /&gt;x1 44305 44474 r r 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to create a column if there is true change of drug(Column 'need'). Drug_1 and drug_2 is nothing but 'drug' separated into different columns.&lt;/P&gt;&lt;P&gt;What is needed (NEED Column above):&lt;/P&gt;&lt;P&gt;1) first row - the drug is t and first drug so column need should have value of 1&lt;/P&gt;&lt;P&gt;2) Second row - the drug is l (so drug changed from t to l) - column value should be 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) third row - the drug is a,l (even though drug l from second row exists here but new drug 'a' is added) - column value should be 3&lt;/P&gt;&lt;P&gt;4) Fourth row - drug is 'a' (previous row drug 'a' exists is here, not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;5) Fifth row - drug is l (fourth row drug 'a' doesn't exists is here, but third row have a,l (a,l changed to a and then to l so continued)&amp;nbsp; -&amp;nbsp; not a true change of drug) - column value should be still 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6)&amp;nbsp;sixth row - drug is c,l&amp;nbsp; (3,4,5 rows have&amp;nbsp; a,l &amp;amp; a &amp;amp; l -&amp;nbsp; but c is added) - column value should be 4.&lt;/P&gt;&lt;P&gt;7)&amp;nbsp;seventh row - drug is l&amp;nbsp; (6 row had c,l&amp;nbsp; and this row had l so no change) - column value should be 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;eighth row - drug is l,r&amp;nbsp; (6 row had c,l and 7row had l - but r is added here ) - column value should be 5&lt;/P&gt;&lt;P&gt;9) ninth row -&amp;nbsp;drug is r&amp;nbsp; (8 row had l,r and this row had r so no change ) - column value should be 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is tricky, sorry if my question is not clear. Appreciate any help. Thank you All.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 04:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-change-of-drug-and-add-incremental-line/m-p/830479#M328278</guid>
      <dc:creator>nkp</dc:creator>
      <dc:date>2022-08-26T04:27:09Z</dc:date>
    </item>
  </channel>
</rss>

