<?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: Read only two column from Excel in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192242#M14666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have an existing data set and can express the records you want with variables in a single record then there is no need to create an additional dataset. Go directly to proc print with your data set and use a WHERE clause to select the records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=Li.llcp2011; /* I put the Li there in case that is the library the dataset resides in you may want to add options NOOBS to suppress the number of observation that will appear with each record and LABEL to print the label instead of the variable name if you have labels assigned.*/&lt;/P&gt;&lt;P&gt;where Physhlth &amp;gt;= 5 and toldhi2=2;&lt;/P&gt;&lt;P&gt;var PHYSHLTH TOLDHI2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jan 2015 23:49:40 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-01-21T23:49:40Z</dc:date>
    <item>
      <title>Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192237#M14661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read a excel into SAS and just print two column of the table? I don't know how to do with this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 22:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192237#M14661</guid>
      <dc:creator>JaneLi</dc:creator>
      <dc:date>2015-01-21T22:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192238#M14662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just print two columns? So not an output data set, just a list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a List task and select the two variables you would like to display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 22:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192238#M14662</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-21T22:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192239#M14663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I read my data from library 1, I only want to get&lt;STRONG&gt; two columns: PHYSHLTH,TOLDHI2. and PHYSHLTH &amp;gt;=5, at the same time TOLDHI2=2).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can anyone help me with my code??&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname Li "C:\Users\yl665\downloads";&lt;/P&gt;&lt;P&gt;proc contents data=Li.llcp2011_abridged; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data llcp2011_abridged; &lt;/P&gt;&lt;P&gt;Set llcp2011;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When (PHYSHLTH &amp;gt;=5 and TOLDHI2=2);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc print DATA llcp2011_abridged;run&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 22:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192239#M14663</guid>
      <dc:creator>JaneLi</dc:creator>
      <dc:date>2015-01-21T22:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192240#M14664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to print two columns as a table. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I read my data from library Li, I only want to get&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt; two columns: PHYSHLTH,TOLDHI2.&amp;nbsp;&amp;nbsp; And PHYSHLTH &amp;gt;=5, at the same time TOLDHI2=2).&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Can anyone help me with my code??&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;libname Li "C:\Users\yl665\downloads";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc contents data=Li.llcp2011_abridged; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Data llcp2011_abridged;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Set llcp2011;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; When (PHYSHLTH &amp;gt;=5 and TOLDHI2=2);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc print DATA llcp2011_abridged;run&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 22:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192240#M14664</guid>
      <dc:creator>JaneLi</dc:creator>
      <dc:date>2015-01-21T22:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192241#M14665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You've posted in EG, I assumed you wanted to use EG Tasks. For coding, its preferable to post in the Procedures Forum. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some uncertainties about your code, it seems disconnected though may be correct, see my questions below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general you can use VAR statement in proc print to keep variables, assuming you want to display VAR1 and VAR2 something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Data llcp2011_abridged; /*Is this data set in LI or created somewhere else?*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Set llcp2011; /*This isn't related to the LI library above?*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp; When (PHYSHLTH &amp;gt;=5 and TOLDHI2=2); /*This should be a WHERE not WHEN*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Proc print DATA llcp2011_abridged; /*This is missing an = sign after the data*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VAR VAR1 VAR2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 22:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192241#M14665</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-21T22:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read only two column from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192242#M14666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have an existing data set and can express the records you want with variables in a single record then there is no need to create an additional dataset. Go directly to proc print with your data set and use a WHERE clause to select the records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=Li.llcp2011; /* I put the Li there in case that is the library the dataset resides in you may want to add options NOOBS to suppress the number of observation that will appear with each record and LABEL to print the label instead of the variable name if you have labels assigned.*/&lt;/P&gt;&lt;P&gt;where Physhlth &amp;gt;= 5 and toldhi2=2;&lt;/P&gt;&lt;P&gt;var PHYSHLTH TOLDHI2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 23:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-only-two-column-from-Excel/m-p/192242#M14666</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-21T23:49:40Z</dc:date>
    </item>
  </channel>
</rss>

