<?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: Outputting variable value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696454#M212735</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid confusion, you'll need to insert an underscore in the variable name in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  if vara&amp;gt;'BOT';&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 12:14:21 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2020-11-04T12:14:21Z</dc:date>
    <item>
      <title>Outputting variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696398#M212702</link>
      <description>&lt;P&gt;I want to output a variable with a value greater than BOT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Var_A&lt;/P&gt;&lt;P&gt;120&lt;/P&gt;&lt;P&gt;130&lt;/P&gt;&lt;P&gt;BOT&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;BOT 67 2&lt;/P&gt;&lt;P&gt;BOT 5 7&lt;/P&gt;&lt;P&gt;BOT&lt;/P&gt;&lt;P&gt;MAN&lt;/P&gt;&lt;P&gt;I want to extract those values of the variable greater than BOT&lt;/P&gt;&lt;P&gt;So the output I need is&lt;/P&gt;&lt;P&gt;BOT 67 2&lt;/P&gt;&lt;P&gt;BOT 5 7&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 04:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696398#M212702</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2020-11-04T04:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696401#M212703</link>
      <description>&lt;P&gt;You say that you "&lt;SPAN&gt;want to extract those values of the variable greater than BOT".&amp;nbsp; But as far as I can tell you merely want the lines of data in which the value of the variable VARA is the word "BOT" followed by some non-blank value.&amp;nbsp; In lexicographic ordering I guess that does qualify as "greater than".&amp;nbsp; If so, then:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;input var_a $10.;&lt;BR /&gt;datalines;&lt;BR /&gt;120&lt;BR /&gt;130&lt;BR /&gt;BOT&lt;BR /&gt;123&lt;BR /&gt;BOT 67 2&lt;BR /&gt;BOT 5 7&lt;BR /&gt;BOT&lt;BR /&gt;MAN&lt;BR /&gt;run;&lt;BR /&gt;data want;&lt;BR /&gt;  set have;&lt;BR /&gt;  where var_a =: 'BOT';&lt;BR /&gt;  if var_a&amp;gt;'BOT';&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;The '=:' relation in the where statement tells sas to read in only those records with VAR_A starting with 'BOT'.&amp;nbsp; The subsetting IF then keep only the subset that has something other than a blank following the 'BOT'.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Edit note:&amp;nbsp; Forgot to change &lt;EM&gt;&lt;STRONG&gt;if vara&amp;gt;'BOT'&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; to&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;if var_a&amp;gt;'BOT'&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;for the note.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 13:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696401#M212703</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-11-04T13:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696454#M212735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid confusion, you'll need to insert an underscore in the variable name in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  if vara&amp;gt;'BOT';&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 12:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-variable-value/m-p/696454#M212735</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2020-11-04T12:14:21Z</dc:date>
    </item>
  </channel>
</rss>

