<?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: Proc freq and alphanumeric variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881458#M39091</link>
    <description>&lt;P&gt;I imported the data (in csv) with this code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile = "....csv"&lt;BR /&gt;out = Add&lt;BR /&gt;dbms = csv&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 20:22:10 GMT</pubDate>
    <dc:creator>femiajumobi1</dc:creator>
    <dc:date>2023-06-19T20:22:10Z</dc:date>
    <item>
      <title>Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881455#M39089</link>
      <description>&lt;P&gt;Hi. I need to generate frequencies of specific variables (TEM and DHA) which has alphanumeric values &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TEM has: TEM, TEM-1, TEM-1(b), TEM-10, TEM-10(e)&lt;/P&gt;
&lt;P&gt;DHA has: NEG, DHA-1, DHA-15,DHA-TYPE,DHA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq data=AMR;&lt;BR /&gt;Tables TEM DHA;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS codes showed only the following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="femiajumobi1_0-1687203793328.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85158i582028C869DF6B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="femiajumobi1_0-1687203793328.png" alt="femiajumobi1_0-1687203793328.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;it appears it did not read the alphanumeric values.Kindly suggest what needs to be done. Thanks&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;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>Mon, 19 Jun 2023 19:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881455#M39089</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2023-06-19T19:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881457#M39090</link>
      <description>Back up a step and ensure your data is read in correctly. How did you import your data into SAS?</description>
      <pubDate>Mon, 19 Jun 2023 20:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881457#M39090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-19T20:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881458#M39091</link>
      <description>&lt;P&gt;I imported the data (in csv) with this code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile = "....csv"&lt;BR /&gt;out = Add&lt;BR /&gt;dbms = csv&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 20:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881458#M39091</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2023-06-19T20:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881465#M39092</link>
      <description>PROC IMPORT guesses at the lengths. &lt;BR /&gt;&lt;BR /&gt;Try adding GUESSINGROWS=MAX to the code or write your own data step to read the data in correctly, with the correct lengths and then recheck it.</description>
      <pubDate>Mon, 19 Jun 2023 20:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881465#M39092</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-19T20:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881472#M39093</link>
      <description>&lt;P&gt;I added "guessingrows=max" but it gave this response&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="femiajumobi1_0-1687210988892.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85160i050B7D0B03F8CCAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="femiajumobi1_0-1687210988892.png" alt="femiajumobi1_0-1687210988892.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There is unending running of string variables in the log&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="femiajumobi1_1-1687211053026.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85161iCC45AAF35A82DB8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="femiajumobi1_1-1687211053026.png" alt="femiajumobi1_1-1687211053026.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I changed to "guessingrows=15, but the frequencies omitted the alphanumeric variables still. Kindly suggest a way forward. Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 21:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881472#M39093</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2023-06-19T21:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881473#M39094</link>
      <description>Other option - manually write a data step to import the data. There should be code in the log. Copy, paste that and then modify it as necessary.</description>
      <pubDate>Mon, 19 Jun 2023 21:46:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881473#M39094</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-19T21:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881496#M39095</link>
      <description>&lt;P&gt;NEVER use PROC IMPORT for csv files. You'll spend more time fixing stuff caused by the guessing than you need to write the DATA step yourself.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 06:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881496#M39095</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-06-20T06:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881550#M39096</link>
      <description>&lt;P&gt;The Log window full means that something about the file is generating lots of text. The most likely cause is something related to invalid data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question: did you ever open this CSV file in spreadsheet software? Did you SAVE it after opening with spreadsheet software? If the answer to both of these questions is YES then your file may have had the values changed by the spreadsheet and could be quite unreliable.&lt;/P&gt;
&lt;P&gt;If the answer is know then open the CSV file in some text editing program like Notepad, copy the first 10 rows, then on the forum open a text box using the &amp;lt;/&amp;gt; and paste the text. The text box is important to keep the forum from reformatting white space in text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what your picture shows I have feeling that your data file has many problems. Possibly related to line lengths and misaligned columns. I have a hard time believing that a column that would have value like "65-84 years" also has "&amp;lt;-0.06". That typically would indicate that a column, if the file is actually CSV, has 2 or more different types of values and that is not normal for a proper CSV file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you set Guessingrows to 15 that is even fewer rows than the default.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 15:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881550#M39096</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-20T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881554#M39097</link>
      <description>&lt;P&gt;Thanks. Writing the datastep&amp;nbsp; as shown below does not help either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let path=C:\...;&lt;BR /&gt;options validvarname=v7;&lt;/P&gt;
&lt;P&gt;proc import datafile="&amp;amp;path\....csv"&lt;BR /&gt;out=add&lt;BR /&gt;dbms=csv replace;&lt;BR /&gt;guessingrows=max;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 16:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881554#M39097</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2023-06-20T16:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881555#M39098</link>
      <description>&lt;P&gt;The code you posted is not a data step, that's still proc import. A data step would look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data add;
infile "&amp;amp;path\...csv" dsd truncover;
informat var1 $8. var2 8. var3 8. var4 $12.;
input var1 var2 var3 var4;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's a short tutorial on how to do so, and as mentioned previously PROC IMPORT puts the code it uses in the log. You can copy it and modify the type/format as needed for your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://eta.health.usf.edu/publichealth/PHC6701/presentations/2013/readingExternalFilesSAS.pdf" target="_blank"&gt;http://eta.health.usf.edu/publichealth/PHC6701/presentations/2013/readingExternalFilesSAS.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436402"&gt;@femiajumobi1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks. Writing the datastep&amp;nbsp; as shown below does not help either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let path=C:\...;&lt;BR /&gt;options validvarname=v7;&lt;/P&gt;
&lt;P&gt;proc import datafile="&amp;amp;path\....csv"&lt;BR /&gt;out=add&lt;BR /&gt;dbms=csv replace;&lt;BR /&gt;guessingrows=max;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 16:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881555#M39098</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-20T16:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq and alphanumeric variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881561#M39099</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436402"&gt;@femiajumobi1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks. Writing the datastep&amp;nbsp; as shown below does not help either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let path=C:\...;&lt;BR /&gt;options validvarname=v7;&lt;/P&gt;
&lt;P&gt;proc import datafile="&amp;amp;path\....csv"&lt;BR /&gt;out=add&lt;BR /&gt;dbms=csv replace;&lt;BR /&gt;guessingrows=max;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is NOT a DATA step.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 17:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-freq-and-alphanumeric-variable/m-p/881561#M39099</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-06-20T17:17:37Z</dc:date>
    </item>
  </channel>
</rss>

