<?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: problem with reading external file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145372#M28993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a common mistake. EG is a windows product running on your PC that serves as a front end to SAS. SAS itself is running somewhere else.&amp;nbsp; So it cannot see the files on your windows machine.&lt;/P&gt;&lt;P&gt;Why not just convert to using CARDS (or as they now call it DATALINES) statement and paste the contents of your file into your program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Mar 2014 17:12:34 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-03-16T17:12:34Z</dc:date>
    <item>
      <title>problem with reading external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145371#M28992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have bought Enterprise Guide 6.1 + license to learn basic SAS to study, and try to follow small pieces of code there.&lt;/P&gt;&lt;P&gt;For this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename ch5_154 'C:\SAS_OnDemand_for_Professionals\Raw_files\ch5_154.txt';&lt;/P&gt;&lt;P&gt;data exercise;&lt;/P&gt;&lt;P&gt; infile ch5_154;&lt;/P&gt;&lt;P&gt; input ID $ 1-4 Age $ 6-7 ActLevel $ 9-12 Gender $ 14;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I got this message in a log:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist, /sso/biconfig/930/Lev1/SASApp/C:\SAS_OnDemand_for_Professionals\Raw_files\ch5_154.txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Here is the file&amp;nbsp; 'C:\SAS_OnDemand_for_Professionals\Raw_files\ch5_154.txt' content:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2810 61 MOD F&lt;/P&gt;&lt;P&gt;2804 28 HIGH F&lt;/P&gt;&lt;P&gt;2807 42 LOW M&lt;/P&gt;&lt;P&gt;2816 26 HIGH M&lt;/P&gt;&lt;P&gt;2833 32 MOD F&lt;/P&gt;&lt;P&gt;2823 29 HIGH M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Log shows this extra piece in file address added automatically:&amp;nbsp; /sso/biconfig/930/Lev1/SASApp/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I did not see anything in Options to fix that, and I could not locate related&amp;nbsp; properties to remove this extra.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Can anyone help? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Vladimir&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 15:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145371#M28992</guid>
      <dc:creator>vkievsky</dc:creator>
      <dc:date>2014-03-16T15:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with reading external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145372#M28993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a common mistake. EG is a windows product running on your PC that serves as a front end to SAS. SAS itself is running somewhere else.&amp;nbsp; So it cannot see the files on your windows machine.&lt;/P&gt;&lt;P&gt;Why not just convert to using CARDS (or as they now call it DATALINES) statement and paste the contents of your file into your program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 17:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145372#M28993</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-16T17:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with reading external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145373#M28994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; When you use the SAS OnDemand for Professionals license to access SAS on the "cloud" server, you CANNOT read from your local C: drive. That "extra" information appended to the FILENAME is the UNIX directory on the OnDemand server that is your "default" location. Anytime SAS OnDemand for Professionals reads a data file, it looks in the server default location, which is &lt;STRONG&gt;/sso/biconfig/930/Lev1/&lt;SPAN style="color: #ff00ff;"&gt;SASApp&lt;/SPAN&gt;&lt;/STRONG&gt; -- note how the name of the server in the screen shot is&lt;SPAN style="color: #ff00ff;"&gt;&lt;STRONG&gt; SASApp&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Depending on which book you are using or which course you are taking, the FILENAME statement&amp;nbsp; or INFILE statement would be different. I do not recognize the name&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;filename ch5_154 'C:\SAS_OnDemand_for_Professionals\Raw_files\ch5_154.txt';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;as belonging to one of the books that is currently loaded on the server, which could be problematic for you if your data is *NOT* loaded on the OnDemand server. What book are you using? As you can see in the second screen shot, there are a limited number of books loaded on the server.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;But, I wanted to show that data could be read from the server, given the right location. So, instead, my code below reads the CITYDATA.DAT file that is in the Certification Prep Guide directory, as shown in the screen shot:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data work.citypop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; length city $25;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; infile '~/bookdata/sas_cert_prep_guides/citydata.dat';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; input city $ pop70 pop80;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=work.citypop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;filename cpop '~/bookdata/sas_cert_prep_guides/citydata.dat';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data work.citypop2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; length city $25;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; infile cpop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; input city $ pop70 pop80;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=work.citypop2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; According to the guidelines for SAS OnDemand for Professionals, you CANNOT read your personal C:\ drive files. See these links:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/learn/ondemand/professionals/index.html#s1=2" title="http://support.sas.com/learn/ondemand/professionals/index.html#s1=2"&gt;SAS OnDemand for Professionals&lt;/A&gt; (sentence that starts: Note: SAS OnDemand for Professionals: Enterprise Guide &lt;STRONG&gt;does not have the capability for uploading of personal data&lt;/STRONG&gt;.)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/learn/ondemand/professionals/faq.html#data" title="http://support.sas.com/learn/ondemand/professionals/faq.html#data"&gt;SAS OnDemand for Professionals&lt;/A&gt; (FAQ about the data)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; The only courses and books that work with the SAS OnDemand for Professionals server are the ones listed here (&lt;A href="http://support.sas.com/learn/ondemand/professionals/index.html#s1=4" title="http://support.sas.com/learn/ondemand/professionals/index.html#s1=4"&gt;SAS OnDemand for Professionals&lt;/A&gt; [Learning Options tab]). The only exception to this is if you are using a similar license called SAS OnDemand for Academics, where your professor can load data for his/her course onto the server. If this is your usage scenario, then your instructor should give you the correct *server* location (not C: drive location) for the uploaded data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10616i675D53CEC86E7B01/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="list_of_bookdata_folder.png" title="list_of_bookdata_folder.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10617i65CAEBFF85E1ECAB/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="INFILE_SODP.png" title="INFILE_SODP.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 17:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-reading-external-file/m-p/145373#M28994</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-16T17:49:13Z</dc:date>
    </item>
  </channel>
</rss>

