<?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: How to check if a var is null within Proc SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103119#M28890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when missing(variablename) then ...&lt;/P&gt;&lt;P&gt;would be the general approach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2013 20:20:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-04-09T20:20:02Z</dc:date>
    <item>
      <title>How to check if a var is null within Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103118#M28889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a proc sql statement that I'm trying to check if a variable is null or not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt;create table x&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;select id, case when Search = 'Yahoo' then '&amp;lt;a href="www.yahoo.com"&amp;gt;Yahoo&amp;lt;/a&amp;gt;' || ' ' ||&amp;nbsp;&amp;nbsp;&amp;nbsp; ??????&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point I want to replace ?????? with a way to check my variable to see if there is data or not.&amp;nbsp; If there is I want to add more text if not then continue to the next step.&lt;/P&gt;&lt;P&gt;I want to add brackets around my value if it isn't null. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex. The variable has data :&amp;nbsp; Yahoo&amp;nbsp; [Bob]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex. The variable no data :&amp;nbsp; Yahoo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 20:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103118#M28889</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2013-04-09T20:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a var is null within Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103119#M28890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when missing(variablename) then ...&lt;/P&gt;&lt;P&gt;would be the general approach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 20:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103119#M28890</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-04-09T20:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a var is null within Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103120#M28891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp; Would that when belong to another case statement?&lt;/P&gt;&lt;P&gt;Within this contatnation i'm doing there will be multiple variables that could be null and if they are I don't want the text that identifies them to display.&amp;nbsp; I want it to display only if there is data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 20:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103120#M28891</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2013-04-09T20:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a var is null within Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103121#M28892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another case statement at this point. I'm not sure how many levels of nesting SAS SQL will handle. It may be worth looking into a datastep at least for manipulating the individual variables to have the [] or whatnot done to them and then an appropriate CATX CATS or whichever to concatenate them into one variable to insert in to the final string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 21:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103121#M28892</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-04-09T21:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a var is null within Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103122#M28893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp; I'm going to start out the morning trying to use a data step.&amp;nbsp; I think with an if statement and catx or cats I can get it working that way.&lt;/P&gt;&lt;P&gt;I will reply my results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 12:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-var-is-null-within-Proc-SQL/m-p/103122#M28893</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2013-04-10T12:43:48Z</dc:date>
    </item>
  </channel>
</rss>

