<?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: Basic analytics - practicing using syntax with my own data (Excel) in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616518#M393</link>
    <description>&lt;P&gt;I was able to create a libname but get errors with my proc contents step (note: my worksheets within my animal data workbook are named as "2014 Counties"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;options validvarname=v7;&lt;BR /&gt;libname mydata xlsx "/folders/myfolders/sasuser.v94/animaldata.xlsx";&lt;BR /&gt;&lt;BR /&gt;proc contents data=mydata.2014 counties;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;Errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Couldn't find range or sheet in spreadsheet&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: File MYDATA.'2014'n.DATA does not exist.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE,&lt;/DIV&gt;&lt;DIV class="sasError"&gt;MT, MTYPE, NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/DIV&gt;</description>
    <pubDate>Fri, 10 Jan 2020 15:58:44 GMT</pubDate>
    <dc:creator>AJS1</dc:creator>
    <dc:date>2020-01-10T15:58:44Z</dc:date>
    <item>
      <title>Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616223#M389</link>
      <description>&lt;P&gt;I wanted to try using some of the analytics I learned in lessons 1 through 3 with my own data - do I need a license to access Excel data when using SAS University Edition/SAS Studio?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 15:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616223#M389</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-09T15:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616238#M390</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304846"&gt;@AJS1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to read Excel files when using University Edition. Do you have an error you can post? The key is to put the Excel file in the in the location where your PG1 data is. That is the location the virtual box knows about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely a folder somewhere that ends like this 'VirtualBox VMs\SAS University Edition 1\myfolders'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 15:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616238#M390</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2020-01-09T15:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616255#M391</link>
      <description>SAS UE includes the licenses to access and create Excel data.</description>
      <pubDate>Thu, 09 Jan 2020 16:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616255#M391</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-09T16:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616491#M392</link>
      <description>&lt;P&gt;...and, in addition to the other suggestions, our Programming 1 class shows several examples of reading and writing Excel files. This will work with SAS University Edition and SAS OnDemand for Academics. With a local or server install of SAS at your site, you'll need to be running 9.4 Maintenance Release 2 or higher to use the XLSX Libname engine that we show in Programming 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 14:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616491#M392</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-01-10T14:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616518#M393</link>
      <description>&lt;P&gt;I was able to create a libname but get errors with my proc contents step (note: my worksheets within my animal data workbook are named as "2014 Counties"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;options validvarname=v7;&lt;BR /&gt;libname mydata xlsx "/folders/myfolders/sasuser.v94/animaldata.xlsx";&lt;BR /&gt;&lt;BR /&gt;proc contents data=mydata.2014 counties;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;Errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Couldn't find range or sheet in spreadsheet&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: File MYDATA.'2014'n.DATA does not exist.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, CENTILES, DATA, DETAILS, DIR, DIRECTORY, FMTLEN, LIB, MEMTYPE,&lt;/DIV&gt;&lt;DIV class="sasError"&gt;MT, MTYPE, NODETAILS, NODS, NOPRINT, ORDER, OUT, OUT2, SHORT, VARNUM.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jan 2020 15:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616518#M393</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-10T15:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616535#M394</link>
      <description>&lt;P&gt;Is the worksheet name "2014 counties". With a space?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a quick look it looks like you are telling SAS to look for data=2014 counties. That space is critical. SAS is looking for a worksheet only called '2014', then trying to use counties as an option.Which is causing the both errors. Can't find the sheet, can't use counties as an option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you need to do is tell SAS that there is a space in the sheet name. To do that place the sheet name within quotes with an &lt;STRONG&gt;n&lt;/STRONG&gt; at the end. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents data=mydata.&lt;STRONG&gt;'2014 counties'n&lt;/STRONG&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 16:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616535#M394</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2020-01-10T16:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616537#M395</link>
      <description>&lt;P&gt;Yes, there is a space.&amp;nbsp; I used your code and it worked! If I rename my worksheets (prior to making a libname) so that there are no spaces can I use:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc contents data=mydata.&lt;/SPAN&gt;&lt;STRONG&gt;2014 counties;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 16:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616537#M395</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-10T16:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616541#M396</link>
      <description>&lt;P&gt;Yes, but you do have to follow naming rules in SAS. In Excel there are really no naming rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Off the top of my head SAS tables must:&lt;/P&gt;
&lt;P&gt;- Start with a letter or underscore (your sheet 2014 counties does not)&lt;/P&gt;
&lt;P&gt;- Not contain any symbols or spaces (yours does)&lt;/P&gt;
&lt;P&gt;- Max of 32 characters I think&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Multiple was to address this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;One is to name your worksheets following SAS table name rules.&lt;/LI&gt;
&lt;LI&gt;Another would be to use&lt;STRONG&gt; "2014 counties"n&lt;/STRONG&gt; as a table name when referring to it in SAS like I showed you. You would use whatever works best for you. You would need to use this if your worksheet names do not follow SAS table naming conventions. I prefer to not have to use &lt;STRONG&gt;"&amp;lt;table name&amp;gt;"n&amp;nbsp;&lt;/STRONG&gt;so i'll name my worksheets accordingly.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for your specific example. Name the Excel worksheet &lt;STRONG&gt;Counties2014&lt;/STRONG&gt; &lt;EM&gt;(or anything that follows SAS naming rules like _2014Counties, _Counties2014, Counties_2014, etc)&lt;/EM&gt;. Then when you use PROC CONTENTS you can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc contents data=mydata.&lt;/SPAN&gt;&lt;STRONG&gt;Counties2014;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This will work without the "&amp;lt;table name&amp;gt;"n because the Excel worksheet name follows SAS naming rules for tables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope that's clear. Let me know if you have any more questions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Peter&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 16:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616541#M396</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2020-01-10T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Basic analytics - practicing using syntax with my own data (Excel)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616544#M397</link>
      <description>&lt;P&gt;Wonderful advice.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 17:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Basic-analytics-practicing-using-syntax-with-my-own-data-Excel/m-p/616544#M397</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-10T17:00:19Z</dc:date>
    </item>
  </channel>
</rss>

