<?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 Parsing Out data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516138#M3080</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data clinical1;
length str $300;
 set clinical;
  by pat_id;
  retain str "";

  if first.pat_id then str=event_res; 
  else str=catx('@',str,event_res); /*Concatenate String and use @ or any other     symbol to identify the Levels*/
  str=TRANWRD(str,'],',']@') ;

  if last.pat_id;
  str="@"||str;

  drop event_res;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a dataset that has two variables Pat_ID and STR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The STR variable has multiple values within the cell with each value corresponding to a level. The levels range from 1 to 5 and some cells have contain different values that correspond to the same level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example PAT_ID ...0250 has two level 3 events vital signs and blood. I would like to create a table that parses out each value based on its level. so PAT_ID 0250 would have two level 3 columns one for vital signs and the other for blood. Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25183iB5118CBCE4ACBADD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Nov 2018 21:15:24 GMT</pubDate>
    <dc:creator>gbond21</dc:creator>
    <dc:date>2018-11-26T21:15:24Z</dc:date>
    <item>
      <title>Parsing Out data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516138#M3080</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data clinical1;
length str $300;
 set clinical;
  by pat_id;
  retain str "";

  if first.pat_id then str=event_res; 
  else str=catx('@',str,event_res); /*Concatenate String and use @ or any other     symbol to identify the Levels*/
  str=TRANWRD(str,'],',']@') ;

  if last.pat_id;
  str="@"||str;

  drop event_res;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a dataset that has two variables Pat_ID and STR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The STR variable has multiple values within the cell with each value corresponding to a level. The levels range from 1 to 5 and some cells have contain different values that correspond to the same level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example PAT_ID ...0250 has two level 3 events vital signs and blood. I would like to create a table that parses out each value based on its level. so PAT_ID 0250 would have two level 3 columns one for vital signs and the other for blood. Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25183iB5118CBCE4ACBADD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516138#M3080</guid>
      <dc:creator>gbond21</dc:creator>
      <dc:date>2018-11-26T21:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Out data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516142#M3081</link>
      <description>Isn't that the same as the answer here?&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/53486817/concatenate-then-reverse-concatenate" target="_blank"&gt;https://stackoverflow.com/questions/53486817/concatenate-then-reverse-concatenate&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516142#M3081</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-26T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Out data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516152#M3085</link>
      <description>&lt;P&gt;Thanks all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not exactly, that code concatenates the columns, I would like this string from the STR column(which is a result from the above code):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;@Triage and Initial RN Assessment only [level 1]@Blood-peripheral venous [level 3]@Oral meds [level 3]@Patient transport X-ray/CT [Level 4]@Admission or O.R. preparation [level 5]@Triage and Initial RN Assessment only [level 1]@Blood-peripheral venous [level 3]@Oral meds [level 3]@Patient transport&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to display in a separate table as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25185i052D4179686C0198/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516152#M3085</guid>
      <dc:creator>gbond21</dc:creator>
      <dc:date>2018-11-26T21:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Out data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516157#M3089</link>
      <description>You need to provide sample data then and perhaps someone will help. An image means someone has to type out the text.</description>
      <pubDate>Mon, 26 Nov 2018 21:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516157#M3089</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-26T21:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Out data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516160#M3091</link>
      <description>&lt;P&gt;Sorry about that, new to this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample data and sample desired output are attached to this message in the excel file on seperate sheets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Parsing-Out-data/m-p/516160#M3091</guid>
      <dc:creator>gbond21</dc:creator>
      <dc:date>2018-11-26T21:57:05Z</dc:date>
    </item>
  </channel>
</rss>

