<?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 How to categorize data in different variables ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413549#M101234</link>
    <description>&lt;P&gt;Hi, I am a beginner who is working on student edition of SAS. I exported the WhatsApp&amp;nbsp;chat data of a group for 6 months. A part of it is as shown below ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1/18/17, 6:57:00 PM: TSV: Everyone claps for Diana who got selected for job &lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;BR /&gt;1/18/17, 6:58:32 PM: Christopher Walken (techguy): &lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏🏼&lt;/span&gt;&lt;BR /&gt;1/18/17, 6:58:55 PM: TSV: I'm so happy for you Diana More reasons to go shopping &lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;BR /&gt;1/18/17, 7:02:37 PM: Gaggan Anand (next desk): Awesome Diana&lt;BR /&gt;Congrats &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍🏽&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏🏼&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to categorize it into 3 or 4 variables. Date / Time separate&amp;nbsp;or combined, Name and Message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do it but not able to increase&amp;nbsp;the length of data in name and message variable. The last sentence "congrats" also stays in date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me in the codes so that I can separate them and apply if for whole 6 months?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried as shown in the pic below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 02:31:36 GMT</pubDate>
    <dc:creator>agsuthar</dc:creator>
    <dc:date>2017-11-15T02:31:36Z</dc:date>
    <item>
      <title>How to categorize data in different variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413549#M101234</link>
      <description>&lt;P&gt;Hi, I am a beginner who is working on student edition of SAS. I exported the WhatsApp&amp;nbsp;chat data of a group for 6 months. A part of it is as shown below ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1/18/17, 6:57:00 PM: TSV: Everyone claps for Diana who got selected for job &lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;BR /&gt;1/18/17, 6:58:32 PM: Christopher Walken (techguy): &lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏🏼&lt;/span&gt;&lt;BR /&gt;1/18/17, 6:58:55 PM: TSV: I'm so happy for you Diana More reasons to go shopping &lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":woman_dancing:"&gt;💃🏻&lt;/span&gt;&lt;BR /&gt;1/18/17, 7:02:37 PM: Gaggan Anand (next desk): Awesome Diana&lt;BR /&gt;Congrats &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍🏽&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏🏼&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to categorize it into 3 or 4 variables. Date / Time separate&amp;nbsp;or combined, Name and Message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do it but not able to increase&amp;nbsp;the length of data in name and message variable. The last sentence "congrats" also stays in date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me in the codes so that I can separate them and apply if for whole 6 months?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried as shown in the pic below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 02:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413549#M101234</guid>
      <dc:creator>agsuthar</dc:creator>
      <dc:date>2017-11-15T02:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data in different variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413550#M101235</link>
      <description>I tried code as shown below but did not get sufficient output.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DATA WHATSAPP;&lt;BR /&gt;INFORMAT DATE_TIME MDYAMPM18. NAME $CHAR20. MESSAGE $CHAR100.;&lt;BR /&gt;INPUT DATE_TIME &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78374"&gt;@21&lt;/a&gt; NAME @26 MESSAGE;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1/18/17, 6:57:00 PM: TSV: Everyone claps for Diana who got selected for job&lt;BR /&gt;1/18/17, 6:58:32 PM: Christopher Walken (techguy):&lt;BR /&gt;1/18/17, 6:58:55 PM: TSV: I'm so happy for you Diana More reasons to go shopping&lt;BR /&gt;1/18/17, 7:02:37 PM: Gaggan Anand (next desk): Awesome Diana&lt;BR /&gt;Congrats&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA = WHATSAPP;&lt;BR /&gt;FORMAT DATE_TIME MDYAMPM18.;&lt;BR /&gt;FORMAT NAME $CHAR20.;&lt;BR /&gt;FORMAT MESSAGE $CHAR100.;&lt;BR /&gt;RUN;</description>
      <pubDate>Wed, 15 Nov 2017 02:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413550#M101235</guid>
      <dc:creator>agsuthar</dc:creator>
      <dc:date>2017-11-15T02:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data in different variables ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413750#M101303</link>
      <description>&lt;P&gt;When your code generates error is a good practice on this forum to post the log with the code and errors. Paste the result into a code box opened using the forum menu icon {I}.&lt;/P&gt;
&lt;P&gt;SAS date / time reading informats do not like that , that was in the middle of the date and time. So you need to parse the data a bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;DATA WHATSAPP;
   infile datalines dlm=":" ;
   INFORMAT dttxt $19. NAME $CHAR20. MESSAGE $CHAR100.;
   INPUT dttxt 1-19  NAME MESSAGE;
   date_time = input(compress(dttxt,','),anydtdtm.);
   format date_time datetime20.;
   drop dttxt;
DATALINES;
1/18/17, 6:57:00 PM: TSV: Everyone claps for Diana who got selected for job
1/18/17, 6:58:32 PM: Christopher Walken (techguy):
1/18/17, 6:58:55 PM: TSV: I'm so happy for you Diana More reasons to go shopping
1/18/17, 7:02:37 PM: Gaggan Anand (next desk): Awesome Diana Congrats
;
RUN;&lt;/PRE&gt;
&lt;P&gt;I changed to code to use : as delimiter as the posted example did not actually correspond to the columns specified by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78374"&gt;@21&lt;/a&gt; and @26 when copied to my editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 17:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-in-different-variables/m-p/413750#M101303</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-15T17:25:24Z</dc:date>
    </item>
  </channel>
</rss>

