<?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 Import Problem in SAS Certification</title>
    <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639933#M812</link>
    <description>&lt;P&gt;The log you posted does not agree with the lines of text you posted later.&amp;nbsp; In particular the fact that it made this variable name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Name_____Gender___Age&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;shows a couple of things about the data in the file.&amp;nbsp; First is does NOT use tabs as the delimiter. Most likely it just has spaces.&amp;nbsp; And also that unlike your example lines of data you posted there are five characters between the e in name and the G in gender.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need to use PROC IMPORT to read such a simple file.&amp;nbsp; Just write your own data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  infile 'C:\userid\pathname\Class.txt' truncover firstobs=2;
  length name $7 gender $1 age 8;
  input name gender age;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Apr 2020 01:12:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-04-15T01:12:37Z</dc:date>
    <item>
      <title>Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639922#M808</link>
      <description>&lt;P&gt;I am trying to use code from a sas help page to import the same file class.txt. But sas doesn't recognise the delimiter when I try for some reason. I can get it to import properly with a data step, but I'm confused why I'm getting a different log/result for the same code and file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the log from the sas help center&lt;/P&gt;&lt;PRE&gt;     infile 'C:\&lt;EM&gt;userid&lt;/EM&gt;\&lt;EM&gt;pathname&lt;/EM&gt;\Class.txt' delimiter='09'x MISSOVER DSD lrecl=32767
18 ! firstobs=5 ;
19          informat Name $7. ;
20          informat Gender $1. ;
21          informat Age $3. ;
22          format Name $7. ;
23          format Gender $1. ;
24          format Age $3. ;
25       input
26                   Name  $
27                   Gender  $
28                   Age  $
29       ;
30       if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
31       run;&lt;/PRE&gt;&lt;P&gt;and my log&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;&lt;PRE&gt; infile '/folders/myfolders/practice data/IMPORT DATA/class.txt' delimiter='09'x MISSOVER DSD lrecl=32767 firstobs=5 ;
 96                informat Name_____Gender___Age $20. ;
 97                format Name_____Gender___Age $20. ;
 98             input
 99                         Name_____Gender___Age  $
 100            ;
 101            if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
 102            run;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;The import code is&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;PRE&gt;proc import datafile='/folders/myfolders/practice data/IMPORT DATA/class.txt' 
            out=class
            dbms=dlm
            replace;

	   datarow=5;

     delimiter='09'x;
run;
proc print data=class;
run;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 23:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639922#M808</guid>
      <dc:creator>RyanMcKay</dc:creator>
      <dc:date>2020-04-14T23:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639926#M809</link>
      <description>Firstly, from the log it seems like you have no spaces between your variables in the informat &amp;amp; format statements, so that could be 1 problem. They also don't match the names from the SAS help file, as there are no underscores in the help file. If your variable names all have that underscore in them, I would clean the file prior to importing it, especially if it's only 3 variables. Additionally, the '09'x refers to tab-delimited data. Since your variables have underscores in them, it makes me wonder if they are separated by tabs or spaces. Have you opened the file to check the data prior to importing it?</description>
      <pubDate>Wed, 15 Apr 2020 00:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639926#M809</guid>
      <dc:creator>Sleo007</dc:creator>
      <dc:date>2020-04-15T00:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639929#M810</link>
      <description>Thank you!&lt;BR /&gt;&lt;BR /&gt;This is what's in the file&lt;BR /&gt;&lt;BR /&gt;Name Gender Age&lt;BR /&gt;Joyce F 11&lt;BR /&gt;Thomas M 11&lt;BR /&gt;Jane F 12&lt;BR /&gt;Louise F 12&lt;BR /&gt;James M 12&lt;BR /&gt;John M 12&lt;BR /&gt;Robert M 12&lt;BR /&gt;Alice F 13&lt;BR /&gt;Barbara F 13&lt;BR /&gt;Jeffery M 13&lt;BR /&gt;Carol F 14&lt;BR /&gt;Judy F 14&lt;BR /&gt;Alfred M 14&lt;BR /&gt;Henry M 14&lt;BR /&gt;Jenet F 15&lt;BR /&gt;Mary F 15&lt;BR /&gt;Ronald M 15&lt;BR /&gt;William M 15&lt;BR /&gt;Philip M 16</description>
      <pubDate>Wed, 15 Apr 2020 00:55:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639929#M810</guid>
      <dc:creator>RyanMcKay</dc:creator>
      <dc:date>2020-04-15T00:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639930#M811</link>
      <description>Okay, your values are separated by spaces. Have you tried dlm=" " ? That is the notation for the space delimiter.</description>
      <pubDate>Wed, 15 Apr 2020 00:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639930#M811</guid>
      <dc:creator>Sleo007</dc:creator>
      <dc:date>2020-04-15T00:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639933#M812</link>
      <description>&lt;P&gt;The log you posted does not agree with the lines of text you posted later.&amp;nbsp; In particular the fact that it made this variable name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Name_____Gender___Age&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;shows a couple of things about the data in the file.&amp;nbsp; First is does NOT use tabs as the delimiter. Most likely it just has spaces.&amp;nbsp; And also that unlike your example lines of data you posted there are five characters between the e in name and the G in gender.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need to use PROC IMPORT to read such a simple file.&amp;nbsp; Just write your own data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  infile 'C:\userid\pathname\Class.txt' truncover firstobs=2;
  length name $7 gender $1 age 8;
  input name gender age;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2020 01:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639933#M812</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-15T01:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639937#M814</link>
      <description>&lt;BR /&gt;Thanks Tom,&lt;BR /&gt;&lt;BR /&gt;The spaces between e and g are there, they have just been formatted out when I posted the comment here&lt;BR /&gt;&lt;BR /&gt;This is from the sas help page&lt;BR /&gt;&lt;BR /&gt;"Example 3: Importing a Tab-Delimited File&lt;BR /&gt;&lt;BR /&gt;This example imports the following tab-delimited file and creates a temporary SAS data set named Work.Class."&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Apr 2020 01:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639937#M814</guid>
      <dc:creator>RyanMcKay</dc:creator>
      <dc:date>2020-04-15T01:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639941#M815</link>
      <description>&lt;P&gt;Someone/something has converted the file. The tabs have been replaced by spaces. That is why your original program did not work.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 02:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639941#M815</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-15T02:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Problem</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639951#M816</link>
      <description>I think I have figured it out. In the older versions of the 9.4 book it shows one variable as Name_____Gender___Age after importing. Maybe the practice file "class.txt" hasn't been updated to match the book, so it doesn't format the way the book shows.</description>
      <pubDate>Wed, 15 Apr 2020 03:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Proc-Import-Problem/m-p/639951#M816</guid>
      <dc:creator>RyanMcKay</dc:creator>
      <dc:date>2020-04-15T03:07:05Z</dc:date>
    </item>
  </channel>
</rss>

