<?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 First SAS program in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58725#M16495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use the input method you've shown for importing a spreadsheet.&amp;nbsp; You can either use proc import, assigning the spreadsheet to a libname, or what is called DDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can accomplish the first one simply by clicking on file import, from the menu bar.&amp;nbsp; If you want to see the code that is actually submitted, during the processing one of the questions the system will ask you is whether you want to save the program that was created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Feb 2012 14:55:32 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-19T14:55:32Z</dc:date>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58724#M16494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm writing my first SAS program and I need some guidance on something very simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to read a dataset from an excel file with multiple sheets (but I need to read one sheet). Here's the code I came with that doesn't work sofar. I needed to print the first 20 observations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;* Read data from external file into SAS data set;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; Orders;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;INFILE&lt;/SPAN&gt;&lt;SPAN style="color: #993366;"&gt; 'C:\MySAS\Orders.xls';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet = "test";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;INPUT&lt;/SPAN&gt; OrdNum CustName CustAdd CustCd Item Price;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;PROC&lt;/SPAN&gt; PRINT &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; = Orders;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sheet = "test";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;TITLE&lt;/SPAN&gt; 'MyOrders';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp; Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Feb 2012 14:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58724#M16494</guid>
      <dc:creator>Sasanytics</dc:creator>
      <dc:date>2012-02-19T14:49:42Z</dc:date>
    </item>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58725#M16495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use the input method you've shown for importing a spreadsheet.&amp;nbsp; You can either use proc import, assigning the spreadsheet to a libname, or what is called DDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can accomplish the first one simply by clicking on file import, from the menu bar.&amp;nbsp; If you want to see the code that is actually submitted, during the processing one of the questions the system will ask you is whether you want to save the program that was created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Feb 2012 14:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58725#M16495</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-19T14:55:32Z</dc:date>
    </item>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58726#M16496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for the response. I have tried to import the file, but I keep getting errors that the class is not registered and error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Feb 2012 15:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58726#M16496</guid>
      <dc:creator>Sasanytics</dc:creator>
      <dc:date>2012-02-19T15:16:43Z</dc:date>
    </item>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58727#M16497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first two methods I suggested require the license of a product called SAS/Access for pcfiles.&amp;nbsp; If you don't have that, then your alternatives are either to used DDE (which I wouldn't recommend for someone who is just learning SAS), an already developed macro that uses DDE in the background (which I also wouldn't recommend for someone who is just learning SAS),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or saving the spreadsheet (from within Excel) to a comma delimited file (csv) and then using code very similar to that which you originally were trying to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, in the last case, I'd use proc import and have it save the resulting program and then reviewing the resulting program. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Feb 2012 15:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58727#M16497</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-19T15:26:03Z</dc:date>
    </item>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58728#M16498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I managed to get it to work using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.Orders DATAFILE="C:\MySAS\Orders.xls" DBMS=xls REPLACE;&lt;/P&gt;&lt;P&gt;SHEET="testing";&lt;/P&gt;&lt;P&gt;GETNAMES=YES;&lt;/P&gt;&lt;P&gt;PROC Contents DATA = Work.Orders;&lt;/P&gt;&lt;P&gt;Proc Print DATA = Work.Orders (obs=10);&lt;/P&gt;&lt;P&gt;Title "MyOrders";&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have this question:&lt;/P&gt;&lt;P&gt;I need to create a new variable "NewPrice" to convert the "Price" into a binary variable and assign the value "1" if the "Price" &amp;gt;= 20, otherwise assign "0"&lt;/P&gt;&lt;P&gt;Here's my code that didn't work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT "NewPrice $";&lt;/P&gt;&lt;P&gt;If 'Price' &amp;lt; 20 then 'NewPrice' = 0;&lt;/P&gt;&lt;P&gt;else 'NewPrice' = 1;&lt;/P&gt;&lt;P&gt;Run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2012 03:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58728#M16498</guid>
      <dc:creator>Sasanytics</dc:creator>
      <dc:date>2012-02-20T03:21:25Z</dc:date>
    </item>
    <item>
      <title>First SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58729#M16499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You created a SAS file called orders.&amp;nbsp; All you have to do, now, is modify that file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data orders;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set orders;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp;&amp;nbsp; if Price &amp;lt; 20 then NewPrice = 0;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp;&amp;nbsp; else NewPrice = 1;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2012 03:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/First-SAS-program/m-p/58729#M16499</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-20T03:58:42Z</dc:date>
    </item>
  </channel>
</rss>

