<?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 Null value for a Parameter in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5477#M1748</link>
    <description>I load values into a Parameter for a stored process.  The values come from a sql table.  one of the values that shows up is NO Department with a value of "NO Department".  This apparently does not mean null.   I had the parameters working before I converted them over to a store process.  If the user did not enter or choose anything from the drop down for the dept, I have a case statement that that seemed to work...&lt;BR /&gt;
WHERE mascrs.MscSession = "&amp;amp;Semester" AND CASE  WHEN "&amp;amp;Dept" Not IS MISSING THEN mascrs.MscDept = "&amp;amp;Dept" ELSE mascrs.MscDept NOT IS MISSING  END  &lt;BR /&gt;
&lt;BR /&gt;
However when I make this into a stored process and change the &amp;amp;DEPT parameter so that is lists the name of the dept and the values  I have the "No Department" option and instead of getting everyone for all deptments, I get nothing.&lt;BR /&gt;
&lt;BR /&gt;
Can you help me see a better way to do this?   Thanks</description>
    <pubDate>Tue, 13 Nov 2007 19:04:52 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-11-13T19:04:52Z</dc:date>
    <item>
      <title>Null value for a Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5477#M1748</link>
      <description>I load values into a Parameter for a stored process.  The values come from a sql table.  one of the values that shows up is NO Department with a value of "NO Department".  This apparently does not mean null.   I had the parameters working before I converted them over to a store process.  If the user did not enter or choose anything from the drop down for the dept, I have a case statement that that seemed to work...&lt;BR /&gt;
WHERE mascrs.MscSession = "&amp;amp;Semester" AND CASE  WHEN "&amp;amp;Dept" Not IS MISSING THEN mascrs.MscDept = "&amp;amp;Dept" ELSE mascrs.MscDept NOT IS MISSING  END  &lt;BR /&gt;
&lt;BR /&gt;
However when I make this into a stored process and change the &amp;amp;DEPT parameter so that is lists the name of the dept and the values  I have the "No Department" option and instead of getting everyone for all deptments, I get nothing.&lt;BR /&gt;
&lt;BR /&gt;
Can you help me see a better way to do this?   Thanks</description>
      <pubDate>Tue, 13 Nov 2007 19:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5477#M1748</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-11-13T19:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Null value for a Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5478#M1749</link>
      <description>It doesn't make sense to me that an SQL table can have "NO Department" as a value when the table doesn't.  That is, unless you have created a format for the column value and add a format for a missing value which translates to "NO Department".&lt;BR /&gt;
&lt;BR /&gt;
You need to present the UNformatted values to the user for selection since it is these that will be used to select against the data table.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Wed, 14 Nov 2007 04:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5478#M1749</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-11-14T04:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Null value for a Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5479#M1750</link>
      <description>I'm not sure how the values get put in myself, I tried unchecking the box apply formating when the Parameter Values are loaded. But I get the same thing.  &lt;BR /&gt;
When I Load Parameter Values in EG Filter and query.  It only loads the values.(DeptNUM)&lt;BR /&gt;
For example...(the first line below is a blank)&lt;BR /&gt;
 &lt;BR /&gt;
 18&lt;BR /&gt;
 10&lt;BR /&gt;
 03&lt;BR /&gt;
 97&lt;BR /&gt;
 05&lt;BR /&gt;
 04&lt;BR /&gt;
 08&lt;BR /&gt;
etc.....&lt;BR /&gt;
When I do a Create Stored Process and it takes all my code and puts it into a stored process. I then go into the Stored Process Parameters option and Here it shows me 2 columns... Display as... and Resolves to....  When I first open it up both columns are the same.  I do a load Values and this time choose DeptName for the Display as column and DEPTNUM for  Resolves to&lt;BR /&gt;
I then get the following&lt;BR /&gt;
NO DEPARTMENT	                               NO DEPARTMENT&lt;BR /&gt;
ACADEMIC SUPPORT SERVICES	18&lt;BR /&gt;
ACCOUNTING	                                10&lt;BR /&gt;
ADM SUPR &amp;amp; FIELD SERV	                 03&lt;BR /&gt;
AEROSPACE STUDIES	                 97&lt;BR /&gt;
ARABIC	                                                 05&lt;BR /&gt;
ART	                                                 04&lt;BR /&gt;
BIOLOGY	                                                 08&lt;BR /&gt;
&lt;BR /&gt;
I can not blank out "NO Department" in the Resolves to column ...it requires something.  What I want to happen is if the parameter is not selected ... is blank then give me all of them.  That is how it works before I put it into a Stored proc.&lt;BR /&gt;
Can you tell me how these parameters get set when loading values within a stored process?</description>
      <pubDate>Thu, 15 Nov 2007 20:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5479#M1750</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-11-15T20:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Null value for a Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5480#M1751</link>
      <description>Hi, Cheri:&lt;BR /&gt;
  Here's the deal. When EG builds that parameter list, it allows you to have a 'blank' -- inside EG -- as a possible parameter choice.&lt;BR /&gt;
 &lt;BR /&gt;
However, when EG goes to create a stored process for you and builds the parameter value choices, it does look like you have a user-defined format in place, because otherwise, you would see just the number in both "Display As" and "Resolves To". EG is either putting NO DEPARTMENT into the stored process parameter choice values based on your user defined format -- or is doing it because it does not allow a "blank" character as a choice -- which I can understand. Passing a quoted string or a blank requires that the character be "protected" and  protecting a quote or a space for transmission involves some advanced macro programming that is not easily understandable.&lt;BR /&gt;
&lt;BR /&gt;
But, to deal with the fact that EG put "NO DEPARTMENT" (perhaps based on your user-defined format), you can CHANGE the stored process code for your test. Something like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
%macro testdnum;&lt;BR /&gt;
  %if &amp;amp;DeptNUM = NO DEPARTMENT %then %do;&lt;BR /&gt;
    proc print data=deptdata;&lt;BR /&gt;
        title "No Where clause -- get all departments";&lt;BR /&gt;
     run;&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %else %if &amp;amp;DeptNUM ne NO DEPARTMENT %then %do;&lt;BR /&gt;
      proc print data=deptdata;&lt;BR /&gt;
         where deptnum = &amp;amp;DeptNum;&lt;BR /&gt;
        /*   OR where deptnum = "&amp;amp;DeptNUM";   if the deptnum is character */&lt;BR /&gt;
         title "With Where clause -- get only department &amp;amp;deptnum";&lt;BR /&gt;
       run;&lt;BR /&gt;
  %end;&lt;BR /&gt;
%mend testdnum;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Of course, EG will have put a LOT more code into the stored process. So before you take this approach, you might actually want to contact Tech Support for more help. Changing the code generated by EG can be tricky, because to use Macro conditional logic (%IF), you need to have a macro program (what's defined by the %MACRO and %MEND). &lt;BR /&gt;
&lt;BR /&gt;
You must already have some logic in place in the EG project for what happened when they picked a space. There are other ways to deal with this than the method I suggest.  However, I think that your best bet for a correct answer -- given your data and your parameters and the amount of code you want to conditionally execute -- is to contact Tech Support for help.&lt;BR /&gt;
 &lt;BR /&gt;
To contact Tech Support, go to: &lt;A href="http://support.sas.com" target="_blank"&gt;http://support.sas.com&lt;/A&gt; and on the left hand side, look for the link called "Submit a Problem".&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 15 Nov 2007 22:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Null-value-for-a-Parameter/m-p/5480#M1751</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-11-15T22:05:40Z</dc:date>
    </item>
  </channel>
</rss>

