<?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: I want to create an record level flagging in patient id level table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898248#M355023</link>
    <description>&lt;P&gt;Are the other columns expected to appear in the output? I don't think it is a good idea to name the last variable "1l_2l_flag" if the data has more flag-variables. You may want to post data that is closer to the data you have actually.&amp;nbsp; And please fix the names of your variables so that match the v7 rules - names start with a letter or with an underscore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: and please re-check the code, it doesn't work as expected due to formatted input.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 06:23:55 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2023-10-12T06:23:55Z</dc:date>
    <item>
      <title>I want to create an record level flagging in patient id level table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898247#M355022</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data MyDataset; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;input id $4. 1L_flag $4. 2L_flag $4.; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;datalines; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 1L 0&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 1L 2L&lt;/P&gt;&lt;P&gt;3 1L 0&lt;/P&gt;&lt;P&gt;4 1L 2L&lt;/P&gt;&lt;P&gt;5 1L 2L&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want an output like&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;id 1L_flag 2L_flag&amp;nbsp; 1l_2l_flag&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1L&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1L&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp;1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1L&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp;1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1L&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; 1L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2L&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;As we can see in the ouptut the flag made the patient level table to record level by flagging&amp;nbsp;&lt;BR /&gt;So If patients had 1l Only flag will give only 1L&lt;BR /&gt;if they 1L &amp;amp; 2L as well then they will have 2 records in the same flags&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;[Note: In dataset I have multiple 1l and 2l and 3l .... flags&amp;nbsp;&lt;BR /&gt;and other columns as well with 25 columns&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;16, 456 rows ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could guys help to code and how can we do it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 06:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898247#M355022</guid>
      <dc:creator>carl_miles</dc:creator>
      <dc:date>2023-10-12T06:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create an record level flagging in patient id level table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898248#M355023</link>
      <description>&lt;P&gt;Are the other columns expected to appear in the output? I don't think it is a good idea to name the last variable "1l_2l_flag" if the data has more flag-variables. You may want to post data that is closer to the data you have actually.&amp;nbsp; And please fix the names of your variables so that match the v7 rules - names start with a letter or with an underscore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: and please re-check the code, it doesn't work as expected due to formatted input.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 06:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898248#M355023</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-10-12T06:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create an record level flagging in patient id level table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898249#M355024</link>
      <description>&lt;P&gt;I have renamed the flag-variables, if you insist on using bad names, you will have to edit the array statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.have;
   input id $ flag_L1 $ flag_L2 $;
   datalines;
1 1L 0 
2 1L 2L
3 1L 0
4 1L 2L
5 1L 2L
;

data want;
   set have;

   length flag $ 4;
   array flags flag_L:;

   do i = 1 to dim(flags);
      if flags[i] ^= '0' then do;
         flag = flags[i];
         output;
      end;
   end;

   drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Oct 2023 06:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-an-record-level-flagging-in-patient-id-level/m-p/898249#M355024</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-10-12T06:29:50Z</dc:date>
    </item>
  </channel>
</rss>

