<?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: How to import a delimited txt file in SAS Enterprise Guide? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280939#M56867</link>
    <description>&lt;P&gt;1. Spelling mistake somewhere in your code - First_&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;anem &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;(but not visible so is the&amp;nbsp;code here exactly what you used?)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;2. Make sure the path is correct AND that your SAS installation has access. For example if you are using EG on a server it may not have access to your desktop. In this case you need to use the Wizard or Task to import the data.&amp;nbsp;&lt;/FONT&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;3. Are you sure you need the colon modifiers on your input statement?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2016 22:51:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-28T22:51:54Z</dc:date>
    <item>
      <title>How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280931#M56861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have repared a delimited txt file in my C drive. I try to imput the txt in SAS Enerprise Guide. Here is my SAS code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sales2;
    length First_Name $ 12 Last_Name $18 Gender $1 Job_Title $ 25 Country $ 2;
	infile "C:\Users\999152\temp\sales2.txt" dlm=',';
	input Employee_ID First_Name :$12.
	Last_Name :$18. Gender :$1.  Salary Job_Title :$25. Country :$2.
	Birth_Date :date. Hire_Date :mmddyy.;
	format Salary dollar12. Birth_Date Hire_Date monyy7.;
run; 

proc print data= work.sales2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I got error message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Variable First_anem is uninitialized.
ERROR: Physical file does not exist, C:\Users\999152\temp\sales2.txt.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.SALES2 may be incomplete.  When this step was stopped there were 0 observations and 10 variables.
WARNING: Data set WORK.SALES2 was not replaced because this step was stopped.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I input delimited txt file into SAS and convert it&amp;nbsp;into SAS data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Nancy&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 22:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280931#M56861</guid>
      <dc:creator>Nancy05</dc:creator>
      <dc:date>2016-06-28T22:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280939#M56867</link>
      <description>&lt;P&gt;1. Spelling mistake somewhere in your code - First_&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;anem &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;(but not visible so is the&amp;nbsp;code here exactly what you used?)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;2. Make sure the path is correct AND that your SAS installation has access. For example if you are using EG on a server it may not have access to your desktop. In this case you need to use the Wizard or Task to import the data.&amp;nbsp;&lt;/FONT&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;3. Are you sure you need the colon modifiers on your input statement?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 22:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280939#M56867</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-28T22:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280941#M56868</link>
      <description>&lt;P&gt;Your main problem is probably that SAS is running somewhere other than your PC and so it cannot see files on your C: drive. &amp;nbsp;Either put the file somewhere that can be seen by the SAS process or use some EG tool/process to upload the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also your program is a little over complicated. I find it much easier to define the variables and then input them.&amp;nbsp;You should use the DSD option so that empty values (adjacent delimiters) will be properly treated. &amp;nbsp;You don't need colon modifiers. In fact don't include informats in the INPUT statement at all. You dont need them for numbers or character strings and for dates and times use and INFORMAT statement (or INFORMAT= option on ATTRIB statement) to let SAS know how to translate the raw data stream.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sales2;
  length Employee_ID 8 First_Name $12 Last_Name $18 Gender $1
         Salary 8 Job_Title $25 Country $2 Birth_Date 8 Hire_Date 8
  ;
  infile "C:\Users\999152\temp\sales2.txt" dsd truncover ;
  input Employee_ID -- Hire_Date ;
  informat Salary comma. Birth_Date date. Hire_Date mmddyy.;
  format Salary dollar12. Birth_Date Hire_Date monyy7.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also need to add FIRSTOBS=2 to the INPUT statement if the file has a header row.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 23:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280941#M56868</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-28T23:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280942#M56869</link>
      <description>&lt;P&gt;Hi Reeze,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Yes. I have&amp;nbsp;corrected my variable name. First_Name is correct.&lt;/P&gt;&lt;P&gt;2. Yes. The file path is correct. I agree with that EG on a server it may not have access to my desktop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;How do I use Task/Wizard to import the data?&lt;/STRONG&gt; Task-&amp;gt; Data -&amp;gt; ????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;I could see anything from Task menu I could import the file. I have tried Task -&amp;gt; Data-&amp;gt; Upload Data Files to Server. It can only&amp;nbsp;&amp;nbsp;&amp;nbsp; upload SAS file. But I need convert text file to SAS file first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Yes. I don't have to use the colon modiferies on my input statement. So I have modified the SAS code and still get the error messag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sales2;
    length First_Name $ 12 Last_Name $18 Gender $1 Job_Title $ 25 Country $ 2;
	infile "C:\Users\999152\temp\Sales2.txt" dlm=',';
	input Employee_ID First_Name $
	Last_Name $ Gender $  Salary  Job_Title Country $
	Birth_Date :date. Hire_Date :mmddyy.;
	format Salary dollar12. Birth_Date Hire_Date monyy7.;
run; 

proc print data= work.sales2;
run;

ERROR: Physical file does not exist, C:\Users\999152\temp\Sales2.txt.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.SALES2 may be incomplete.  When this step was stopped there were 0 observations and 9 variables.
WARNING: Data set WORK.SALES2 was not replaced because this step was stopped.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp; Nancy&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 23:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280942#M56869</guid>
      <dc:creator>Nancy05</dc:creator>
      <dc:date>2016-06-28T23:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280943#M56870</link>
      <description>&lt;P&gt;Check out this blog post on tools for copy files. &amp;nbsp;If you have an older version of EG there is a link to earlier post that might work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2015/03/12/enterprise-guide-71-tasks/" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2015/03/12/enterprise-guide-71-tasks/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 23:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280943#M56870</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-28T23:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280948#M56873</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you blog post. The "Copy files"&amp;nbsp;screen looks good, it is what I need. The problem is that&amp;nbsp;I could not see such usful tool/window in my EG. I use EG 7.12.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use &lt;STRONG&gt;Task-&amp;gt; Data -&amp;gt; Upload Data Files to Server&lt;/STRONG&gt;, I got this screen&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="UploadDataFilesToServer.GIF" alt="UploadDataFilesToServer.GIF" src="https://communities.sas.com/t5/image/serverpage/image-id/3829iFBC6B845AFBE8D0E/image-size/small?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I access the screen showed in your post log?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10pt;"&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2015/03/12/enterprise-guide-71-tasks/" target="_blank"&gt;&lt;FONT color="#0000ff"&gt;http://blogs.sas.com/content/sasdummy/2015/03/12/enterprise-guide-71-tasks/&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10pt;"&gt;Nancy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 23:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280948#M56873</guid>
      <dc:creator>Nancy05</dc:creator>
      <dc:date>2016-06-28T23:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280950#M56874</link>
      <description>&lt;P&gt;These are custom tasks. You need to download and install them, and you probably need admin privileges to do so.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the File menu for an option to import data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 00:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280950#M56874</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-29T00:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280961#M56881</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;File-&amp;gt; import Data&lt;/STRONG&gt; works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nancy&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 01:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/280961#M56881</guid>
      <dc:creator>Nancy05</dc:creator>
      <dc:date>2016-06-29T01:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a delimited txt file in SAS Enterprise Guide?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/281296#M57020</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for giving the hint of using dsd. I have put the file in shared file drive and make it working. I have replaced the driver name and path name in the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sales3;
    length Employee_ID 8 First_Name $ 12 Last_Name $18 Gender $1 
	Salary 8 Job_Title $ 25 Country $ 2; 
	infile "\\&amp;lt;driver Name&amp;gt;\&amp;lt;Path Name&amp;gt;\Sales3.txt" dsd truncover;
	input Employee_ID First_Name Last_Name Gender Salary Job_Title Country Birth_Date :date.
	Hire_Date :mmddyy.;
	informat Salary comma. Birth_Date date. *Hire_Date :mmddyy.;
	format Salary dollar12. Birth_Date monyy7. Hire_Date DATE9.;
	label Job_Title= 'Sales Title' Birth_Date='Birth Date' Hire_Date = 'Hire Date';
run; 

Title "Import raw data text file test";
proc print data= work.sales3 label;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nancy&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 21:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-a-delimited-txt-file-in-SAS-Enterprise-Guide/m-p/281296#M57020</guid>
      <dc:creator>Nancy05</dc:creator>
      <dc:date>2016-06-29T21:58:14Z</dc:date>
    </item>
  </channel>
</rss>

