<?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: Importing a .xlsx file into SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307518#M61099</link>
    <description>&lt;P&gt;Hey ballardw, thanks for the advice. I used the Proc Import Statement, but then I get an error message with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\Users\G_FABRE\Documents\445_695\Assignment_2\Accidents_x.xls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=excel ;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data=&amp;nbsp;&amp;nbsp; (firstobs=1 obs=100);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see where I made a mistake in this code ...&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2016 23:00:17 GMT</pubDate>
    <dc:creator>gf1996</dc:creator>
    <dc:date>2016-10-26T23:00:17Z</dc:date>
    <item>
      <title>Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307506#M61096</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;In this assignment I have to do, it says I have to read an xlsx file to SAS, but I'm struggling to find out how to do ...&lt;/P&gt;&lt;P&gt;Could someone help me out ? Thanks.&lt;/P&gt;&lt;P&gt;Here is the Assignment question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dataset Accident_x.xls (added to the Assignment 2 folder) contains information on motor vehicle&lt;BR /&gt;accidents collected by the US Bureau of Transportation.&lt;BR /&gt;&lt;BR /&gt;a)&amp;nbsp;&amp;nbsp; &amp;nbsp;Read the file into Assign2.Accident_new and review the data descriptor. Print first 100 observations.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 21:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307506#M61096</guid>
      <dc:creator>gf1996</dc:creator>
      <dc:date>2016-10-26T21:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307513#M61098</link>
      <description>&lt;P&gt;Start with proc import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then Proc contents&lt;/P&gt;
&lt;P&gt;Then proc print (hint there are several options to limit the number of records printed)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 22:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307513#M61098</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-26T22:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307518#M61099</link>
      <description>&lt;P&gt;Hey ballardw, thanks for the advice. I used the Proc Import Statement, but then I get an error message with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\Users\G_FABRE\Documents\445_695\Assignment_2\Accidents_x.xls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=excel ;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data=&amp;nbsp;&amp;nbsp; (firstobs=1 obs=100);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see where I made a mistake in this code ...&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 23:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307518#M61099</guid>
      <dc:creator>gf1996</dc:creator>
      <dc:date>2016-10-26T23:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307525#M61100</link>
      <description>&lt;P&gt;Please post your &lt;STRONG&gt;log&lt;/STRONG&gt; too with the error message, beyond your code.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 23:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307525#M61100</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-26T23:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307584#M61108</link>
      <description>&lt;P&gt;Are you using SAS University Edition? &amp;nbsp;If so the path to C: would be invalid as paths are different on that. &amp;nbsp;Need to read the documentation for that. &amp;nbsp;Updated your code as its hard to read with mixed case (being able to read code is far more important than what it actually does):&lt;/P&gt;
&lt;PRE&gt;proc import out=assign2.accident_new 
            datafile="c:\users\g_fabre\documents\445_695\assignment_2\accidents_x.xls"
            dbms=excel;
run;

proc print data=   (firstobs=1 obs=100);  /* Error on this line, nothing in data=______ */
run;&lt;/PRE&gt;
&lt;P&gt;There is one error I can see, highlighted above, you have not specified a dataset after the data= in the proc print. &amp;nbsp;There is a default position in SAS that it uses the last step's data if nothing is supplied, however I would advise never to use such a thing - if you add more code in you would get odd results. &amp;nbsp;Always be explicit and clear in your code. &amp;nbsp;After some years in the industry you will have had to pick up other peoples code, and then you will understand why this is important.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 08:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307584#M61108</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-27T08:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307749#M61126</link>
      <description>&lt;P&gt;Here is my new modified code for this exercice:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\445_695\Course_Data"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=xlsx;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data=&amp;nbsp;&amp;nbsp; (firstobs=1 obs=100);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Here is my log:&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\445_695\Course_Data"&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=xlsx;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;BR /&gt;&lt;BR /&gt;ERROR: Library name is not assigned.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.15 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&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>Thu, 27 Oct 2016 19:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307749#M61126</guid>
      <dc:creator>gf1996</dc:creator>
      <dc:date>2016-10-27T19:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307752#M61129</link>
      <description>&lt;P&gt;Ok thanks, just modified my code. But now I get the following error message once I submit it:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDITOR:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\445_695\Course_Data\Accidents_x"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=xlsx;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data= Assign2.Accident_new (firstobs=1 obs=100);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC IMPORT OUT= Assign2.Accident_new DATAFILE= "C:\445_695\Course_Data\Accidents_x"&lt;BR /&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=xlsx;&lt;BR /&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;BR /&gt;&lt;BR /&gt;ERROR: Library name is not assigned.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What should I do regarding the unassigned library ? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307752#M61129</guid>
      <dc:creator>gf1996</dc:creator>
      <dc:date>2016-10-27T20:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a .xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307856#M61134</link>
      <description>&lt;P&gt;You need to have a library assignment statement before the import, something like:&lt;/P&gt;
&lt;P&gt;libname&amp;nbsp;&lt;SPAN&gt;Assign2 "c:\mypath";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would suggest you have a look over the SAS introductory courses, and other help documentation as this is probably the first thing you need to learn about using SAS.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/training/tutorial/" target="_blank"&gt;http://support.sas.com/training/tutorial/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 07:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-a-xlsx-file-into-SAS/m-p/307856#M61134</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-28T07:59:08Z</dc:date>
    </item>
  </channel>
</rss>

