<?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 Reading raw files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343545#M78872</link>
    <description>&lt;P&gt;can anyone help me this out and provide me the details? I'm totally lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13590i0BB1ED7C305362AD/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
    <pubDate>Thu, 23 Mar 2017 00:39:37 GMT</pubDate>
    <dc:creator>pwang14</dc:creator>
    <dc:date>2017-03-23T00:39:37Z</dc:date>
    <item>
      <title>Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343545#M78872</link>
      <description>&lt;P&gt;can anyone help me this out and provide me the details? I'm totally lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13590i0BB1ED7C305362AD/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 23 Mar 2017 00:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343545#M78872</guid>
      <dc:creator>pwang14</dc:creator>
      <dc:date>2017-03-23T00:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343548#M78874</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; That exercise is from the Programming 1 course, as we teach it in the classroom. The fact that this is a chapter 7 exercise tells me that this&amp;nbsp;is from&amp;nbsp;one of the older versions of the course. In the current version of the course, this exercise is in Chapter 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The starter file for the course has the "beginning" statements you need -- if you got the programs that went with that edition of the course. IF you did not get the programs that go with the book, then you'll have to type approximately 7 lines of code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's a hint:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Data ?????;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; length ?????;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; infile ????? dlm=',';&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; input ?????;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; proc print data=?????;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;If you have the whole book with the exercise, and not just one page, then&amp;nbsp;the solution to the exercise is at the end of the chapter. The Chapter in which this exercise occurs and the previous&amp;nbsp;chapters on INFILE and INPUT and PROC PRINT&amp;nbsp;should have adequate explanation of what all the above statements are for and how they need to be coded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; However, if you are only trying to do the exercise, then here's the explanation:&lt;/P&gt;
&lt;P&gt;1) you need a DATA statement to specify the name of the SAS dataset you are creating;&lt;/P&gt;
&lt;P&gt;2) you need a LENGTH statement because without any other instructions, the default length of character variables will be 8 characters and the instructions specify you need longer lengths for all of&amp;nbsp;the character variables;&lt;/P&gt;
&lt;P&gt;3) you need an INFILE statement to point to the CSV file (you will probably find in the starter program p107e01.sas that the name of the starter file is newemps.csv)&lt;/P&gt;
&lt;P&gt;4) you need an INPUT statement to "parse" the raw data lines and turn the raw data into SAS columns and observations&lt;/P&gt;
&lt;P&gt;5) you need a RUN; statement as a step boundary to terminate the DATA step program&lt;/P&gt;
&lt;P&gt;6) you need a PROC PRINT statement to start the print of the SAS data set you just created. So the name after data= will be the same as the name that appears on your DATA statement in #1&lt;/P&gt;
&lt;P&gt;7) if all you want to do is test PROC PRINT, then you need another RUN; as the step boundary for the PROC PRINT step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If this is homework or you are taking the class from a professor you might want to ask your professor or teaching assistant for more specific help.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 00:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343548#M78874</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-03-23T00:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343554#M78876</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;after I run the soulotions:&lt;/P&gt;&lt;P&gt;data work.NewEmployees;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;length First $12 Last $ 18 Title $ 25;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;infile 'newemps.csv' dlm=',';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;input First $ Last $ Title $ Salary;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist, c:\Users\peng\newemps.csv.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=work.NewEmployees;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i solve this problem?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 01:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343554#M78876</guid>
      <dc:creator>pwang14</dc:creator>
      <dc:date>2017-03-23T01:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343584#M78890</link>
      <description>&lt;P&gt;Read the error message. Do you have the text file in that location? If not, where is it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to include the full path to the CSV file.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 03:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343584#M78890</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-23T03:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343723#M78929</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;As Reeza suggests, the ERROR message is accurately telling you what is wrong. You do not have a correct path to your CSV file.&lt;BR /&gt;&lt;BR /&gt;I am not sure you followed ALL the code in the solution. I believe in the actual solution it has:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile "&amp;amp;path/newemps.csv" dlm=',';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The &amp;amp;PATH is critical. It holds the name of the fully qualified path you are using. Remember in the very first Chapter of the book, the very first demo, you submitted a program to make the data. That program also makes the &amp;amp;PATH helper variable. Here are some examples:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;%let path=/folders/myfolders;&lt;/FONT&gt;&lt;/STRONG&gt; or&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;%let path=/folders/myfolders/ecprg193;&lt;/FONT&gt; &lt;/STRONG&gt;&amp;lt;-- for SAS University Edition&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;%let path=c:\workshop\prg1;&lt;/FONT&gt;&lt;/STRONG&gt; &amp;lt;-- Windows&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;%let path=/home/userid/prg1;&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt;-- SAS On Demand &lt;BR /&gt;&lt;BR /&gt;Next, your setup statements were supposed to include the LIBNAME for ORION:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname orion "&amp;amp;path";&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Because the &amp;amp;PATH helper variable is not just there for purposes of the LIBNAME statement, In Programming 1, we also intend for you to use &amp;amp;PATH in the INFILE statement to supply the fully qualified path.&lt;BR /&gt;&lt;BR /&gt;Or, as an alternative, if you made the course files in C:\sas_class\pg1, then you could do this:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile 'c:\sas_class\pg1\newemps.csv' dlm=',';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;But that means every time you use an INFILE statement, you will have to remember and code the exact correct location.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2020 18:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/343723#M78929</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-01-01T18:04:28Z</dc:date>
    </item>
  </channel>
</rss>

