<?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: Newbie -- Set and Where Statement problems in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Newbie-Set-and-Where-Statement-problems/m-p/326946#M271588</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124588"&gt;@GrizzlyDee&lt;/a&gt; wrote:&lt;BR /&gt;&amp;nbsp;
&lt;P&gt;With this program, I am trying to use an existing Sas table (sasuser.Vehicles.xlsx) to create a new table (vehicles_info) containing a subset of that original data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't believe that statement is correct. Please make sure you have correctly imported the Excel data set into SAS. There is a video recently posted on the SAS Analytics U page on how to import an Excel file. Once the file is imported correctly, you reference it with a two level name, LIBNAME.DATA_SET_NAME&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your dataset is called Vehicles, it would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vehicles_info; 
 set sasuser.Vehicles;
 where make='Ford' and year='2015';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The other possibility is that you have validvarnames=ANY set, which means you would refer to the dataset as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vehicles_info; 
 set sasuser.'Vehicles.xlsx'n;
 where make='Ford' and year='2015';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Jan 2017 04:58:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-01-24T04:58:20Z</dc:date>
    <item>
      <title>Newbie -- Set and Where Statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Newbie-Set-and-Where-Statement-problems/m-p/326914#M271587</link>
      <description>&lt;P&gt;&lt;STRONG&gt;data vehicles_info; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;set sasuser.Vehicles.xlsx;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;where make='Ford' and year='2015';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;proc print data=vehicles_info;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this program, I am trying to use an existing Sas table (sasuser.Vehicles.xlsx) to create a new table (vehicles_info) containing a subset of that original data. The second part of the program's goal is to generate a list report of the new table. When running the code, I've added a visual of the errors coming up in the SAS Studio log below. I have played around with the code in different ways such as omitting .xlsx from the set statement, editing the data set name, capitalizing M in make, using infile + path instead of set statement , nothing has worked. The above program, after all the tinkering, is the one with the least amount of errors. FYI - make variable is listed in the Excel table. Please assist with pointing out where I have gone wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6858iB017F16A92814020/image-size/original?v=1.0&amp;amp;px=-1" alt="SAS error 1.PNG" title="SAS error 1.PNG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 02:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Newbie-Set-and-Where-Statement-problems/m-p/326914#M271587</guid>
      <dc:creator>GrizzlyDee</dc:creator>
      <dc:date>2017-01-24T02:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie -- Set and Where Statement problems</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Newbie-Set-and-Where-Statement-problems/m-p/326946#M271588</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124588"&gt;@GrizzlyDee&lt;/a&gt; wrote:&lt;BR /&gt;&amp;nbsp;
&lt;P&gt;With this program, I am trying to use an existing Sas table (sasuser.Vehicles.xlsx) to create a new table (vehicles_info) containing a subset of that original data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't believe that statement is correct. Please make sure you have correctly imported the Excel data set into SAS. There is a video recently posted on the SAS Analytics U page on how to import an Excel file. Once the file is imported correctly, you reference it with a two level name, LIBNAME.DATA_SET_NAME&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your dataset is called Vehicles, it would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vehicles_info; 
 set sasuser.Vehicles;
 where make='Ford' and year='2015';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The other possibility is that you have validvarnames=ANY set, which means you would refer to the dataset as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vehicles_info; 
 set sasuser.'Vehicles.xlsx'n;
 where make='Ford' and year='2015';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Newbie-Set-and-Where-Statement-problems/m-p/326946#M271588</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-24T04:58:20Z</dc:date>
    </item>
  </channel>
</rss>

