<?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 Incorrect data in column in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608535#M8432</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the frequency count for one of my columns called segments. This column ideally should only have 3 types of segments (Consumer, Corporate and Home Office), however when I used the My Task &amp;gt;Task &amp;gt; Statistics &amp;gt; One-Way Frequencies my results are also including some stray data from the next column like in the image below. Is this a bug or am i doing something wrong?&amp;nbsp;&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="Frequency Count Segments.png" style="width: 349px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34350i3EF1F75E81944F55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Frequency Count Segments.png" alt="Frequency Count Segments.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=WORK.APACSTOREUPDATED;
	tables Segment / plots=(freqplot cumfreqplot);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;above is the code used for this. I have also included the raw data, which is the superstore data we usually use for tableau.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Dec 2019 04:51:53 GMT</pubDate>
    <dc:creator>Kumarathevan</dc:creator>
    <dc:date>2019-12-01T04:51:53Z</dc:date>
    <item>
      <title>Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608535#M8432</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the frequency count for one of my columns called segments. This column ideally should only have 3 types of segments (Consumer, Corporate and Home Office), however when I used the My Task &amp;gt;Task &amp;gt; Statistics &amp;gt; One-Way Frequencies my results are also including some stray data from the next column like in the image below. Is this a bug or am i doing something wrong?&amp;nbsp;&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="Frequency Count Segments.png" style="width: 349px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34350i3EF1F75E81944F55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Frequency Count Segments.png" alt="Frequency Count Segments.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=WORK.APACSTOREUPDATED;
	tables Segment / plots=(freqplot cumfreqplot);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;above is the code used for this. I have also included the raw data, which is the superstore data we usually use for tableau.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 04:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608535#M8432</guid>
      <dc:creator>Kumarathevan</dc:creator>
      <dc:date>2019-12-01T04:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608538#M8433</link>
      <description>&lt;P&gt;There is no possibility&amp;nbsp; of straying into other columns while generating the frequency other than the column specified. Check to see if the raw dataset&amp;nbsp; you have attached and the permanent data you have used are the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For further validation try this step on your data and observe the log :&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;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set WORK.APACSTOREUPDATED;
if segment in ('Jieyang','Orange','Shenzen','Toowoomba') then 
	put 'Segment=' segment;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 05:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608538#M8433</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-12-01T05:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608539#M8434</link>
      <description>&lt;P&gt;Hello r_behata,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the prompt reply. I have double and triple checked on the data source, even tried filtering in excel itself along with tableau and only in SAS I am seeing those additional values. I have even included the raw data so that the same result could be replicated. Also, I am quite new to SAS so I am not entirely sure if I need to do some pre-processing on these data before working on them.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 05:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608539#M8434</guid>
      <dc:creator>Kumarathevan</dc:creator>
      <dc:date>2019-12-01T05:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608540#M8435</link>
      <description>&lt;P&gt;Is the source of your SAS Dataset&amp;nbsp; the Same to the csv file you are referring ? It appears to me that they are not the same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change the path in the code snippet, import the csv file and run the frequency on the imported data and see if you get the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc import datafile="C:\temp\test123.csv"
        out=test123
        dbms=csv
        replace;
         getnames=yes;
run;
&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Dec 2019 05:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608540#M8435</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-12-01T05:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608542#M8436</link>
      <description>&lt;P&gt;Sorry, I just renamed the file before sending it out earlier. The image below is based on the CSV file (test123) that i've uploaded. the result is still the same... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&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="test123Segments.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34351i180142FC08F7DDBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="test123Segments.png" alt="test123Segments.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
 *
 * Task code generated by SAS Studio 3.8 
 *
 * Generated on '12/1/19, 1:48 PM' 
 * Generated by 'u44588303' 
 * Generated on server 'ODAWS04-USW2.ODA.SAS.COM' 
 * Generated on SAS platform 'Linux LIN X64 3.10.0-1062.4.3.el7.x86_64' 
 * Generated on SAS version '9.04.01M6P11072018' 
 * Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36' 
 * Generated on web client 'https://odamid.oda.sas.com/SASStudio/main?locale=en_MY&amp;amp;zone=GMT%252B08%253A00&amp;amp;https%3A%2F%2Fodamid.oda.sas.com%2FSASStudio%2F%3Bc6db82655ce99dc331e2a3a205f631cc_Cluster2=1CD749515D9C70EAE22184785DC751EC.odamid01_SASServer2_1' 
 *
 */

proc freq data=WEBWORK.TEST123;
	tables Segment / plots=(freqplot cumfreqplot);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Dec 2019 05:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608542#M8436</guid>
      <dc:creator>Kumarathevan</dc:creator>
      <dc:date>2019-12-01T05:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608543#M8437</link>
      <description>&lt;P&gt;It took some time to wrap my head around this one but&amp;nbsp; now I think I figured out what is going on. Apparently your raw data has few non-standard characters that sas is having trouble reading .The next column is getting affected&amp;nbsp; whenever it encounters a funky character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example :&lt;/P&gt;
&lt;P&gt;Peter Bühler&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to change the encoding while reading the data and see if this works, this works for me . Specify the encoding in the filename.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

filename tmp_ '/folders/myfolders/sasuser.v94/test123.csv'  ENCODING="WLATIN1";

proc import datafile=tmp_
        out=test123
        dbms=csv
        replace;
         getnames=yes;
run;

proc freq data=test123;
	tables Segment / missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Segment	Frequency	Percent	Cumulative
Consumer	5658	51.75	5658	51.75
Corporate	3264	29.85	8922	81.61
Home Office	2011	18.39	10933	100.00&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 06:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608543#M8437</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-12-01T06:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect data in column</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608545#M8438</link>
      <description>&lt;P&gt;Thank You very much. You are a lifesaver. I did not realize that the formatting would cause an issue like this!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 07:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Incorrect-data-in-column/m-p/608545#M8438</guid>
      <dc:creator>Kumarathevan</dc:creator>
      <dc:date>2019-12-01T07:16:31Z</dc:date>
    </item>
  </channel>
</rss>

