<?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: Retrieve &amp;lt;Name&amp;gt; from a parameter constraint in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1087#M1530</link>
    <description>Thanks Cynthia for the response. But I am looking for a way to capture what I think you are referring to as prompt or in EG terminology "Display As" value and not the sas variable name.</description>
    <pubDate>Tue, 25 Jul 2006 18:16:54 GMT</pubDate>
    <dc:creator>schering</dc:creator>
    <dc:date>2006-07-25T18:16:54Z</dc:date>
    <item>
      <title>Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1085#M1528</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have defined the parameter constraints as &lt;NAME&gt;=&lt;VALUE&gt; pairs. Can anyone tell me how to retrieve the &lt;NAME&gt;? Since &lt;NAME&gt; is defined much more user friendly I would like to use these as part of title/headers of the report. Thanks.&lt;/NAME&gt;&lt;/NAME&gt;&lt;/VALUE&gt;&lt;/NAME&gt;</description>
      <pubDate>Sat, 22 Jul 2006 13:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1085#M1528</guid>
      <dc:creator>schering</dc:creator>
      <dc:date>2006-07-22T13:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1086#M1529</link>
      <description>Hi:&lt;BR /&gt;
  Check out the first program at this web site: [pre]&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/input.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/input.html&lt;/A&gt; [/pre]&lt;BR /&gt;
&lt;BR /&gt;
In this program, it shows the use of the "name" piece of the name/value pairs in a title statement:&lt;BR /&gt;
&lt;B&gt;[pre]title "Product Sales for &amp;amp;MONTH, &amp;amp;YEAR";&lt;BR /&gt;
[/pre]&lt;/B&gt; In this program, &amp;amp;MONTH and &amp;amp;YEAR are the NAMES of the input parameters (without the &amp;amp; in front) -- that means when you defined them as parameters, whatever you put in the SAS Management Console box for "SAS variable name" now becomes the "NAME" of the parameter (or you could do this in EG as well). For example for me to use &amp;amp;MONTH in my title, I had to define an input parameter called MONTH. The VALUE of the parameter comes from the user who sits at the client application and either types in a value or chooses one of the values you have entered in as constraints for your parameter.&lt;BR /&gt;
As long as your macro variable reference -inside- the stored process corresponds to the NAME (NOT the prompt) you defined when you registered the SP, then every time the stored process runs, whatever was selected at the client will now be displayed in your title or footnote statement. Remember that since input parameters from the stored process are global macro variables by the time they get to SAS, you must use double quotes around your title statement in order for macro resolution to take place.&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 25 Jul 2006 16:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1086#M1529</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2006-07-25T16:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1087#M1530</link>
      <description>Thanks Cynthia for the response. But I am looking for a way to capture what I think you are referring to as prompt or in EG terminology "Display As" value and not the sas variable name.</description>
      <pubDate>Tue, 25 Jul 2006 18:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1087#M1530</guid>
      <dc:creator>schering</dc:creator>
      <dc:date>2006-07-25T18:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1088#M1531</link>
      <description>Ahhh, I think I understand. Here's how I'm using the terms -- Let's assume an input parameter for Country:[pre]&lt;BR /&gt;
prompt=Please select a country&lt;BR /&gt;
SAS Variable Name = COUNTRY&lt;BR /&gt;
Macro variable usage in program = &amp;amp;COUNTRY&lt;BR /&gt;
data set var = CUST_CNTRY = 2 char country code&lt;BR /&gt;
possible constraint values:&lt;BR /&gt;
Display AS:     Resolves to:&lt;BR /&gt;
United States    US&lt;BR /&gt;
Italy            IT&lt;BR /&gt;
Ireland          IR&lt;BR /&gt;
[/pre]&lt;BR /&gt;
What you would get if you placed &amp;amp;COUNTRY into a title is 'US' when they select the "Display As" value of 'United States'. And you want to get "United States" in the title???&lt;BR /&gt;
&lt;BR /&gt;
So, let's assume that your WHERE statement or IF statement has something like this:&lt;BR /&gt;
&lt;BR /&gt;
WHERE CUST_CNTRY="&amp;amp;COUNTRY";&lt;BR /&gt;
&lt;BR /&gt;
I'm figuring you may already have a format in place to translate the 2 character country code to a long country name so someplace before your title, you have to translate the short code to the equivalent of the Display As string: [pre]&lt;BR /&gt;
title "for country = %sysfunc(putc(&amp;amp;country,$cntry.))";&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
If your variable is numeric, then you have to use the putn function in your call to %sysfunc. There are other ways to do this with macro processing, but SYSFUNC and a format is one of the easier ways (in my opinion).&lt;BR /&gt;
&lt;BR /&gt;
Is that what you wanted?&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 25 Jul 2006 19:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1088#M1531</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2006-07-25T19:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1089#M1532</link>
      <description>Yes, this is exactly my question. I am using a look-up table approach which is similar to your format catalog solution. But in either case the look-up table or format catalog should be updated every time when the constraint information changes. &lt;BR /&gt;
&lt;BR /&gt;
I was really hoping for a solution that the stored process will return this value(s) as a macro variable or some other way. Thanks.</description>
      <pubDate>Wed, 26 Jul 2006 18:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1089#M1532</guid>
      <dc:creator>schering</dc:creator>
      <dc:date>2006-07-26T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1090#M1533</link>
      <description>OK...I understand what you mean, now. The "Display As" values are used to build the appropriate prompting interface in whichever client application is running the stored process. Since the client application is not built in the SAS layer, there is no visibility (that I know of) for those "Display As" values in the SAS layer. Formats generally are an efficient way to perform table lookups for label substitution, as described in these papers: [pre]http://www2.sas.com/proceedings/sugi24/Coders/p097-24.pdf&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi30/002-30.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi30/002-30.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.bassettconsulting.com/lazy_way.pdfhttp://www.ats.ucla.edu/STAT/sas/library/nesug00/bt3001.pdf" target="_blank"&gt;http://www.bassettconsulting.com/lazy_way.pdfhttp://www.ats.ucla.edu/STAT/sas/library/nesug00/bt3001.pdf&lt;/A&gt;&lt;BR /&gt;
[/pre] so they're worth giving a try. Especially since you can build a SAS format from a data set or table on the fly using the CNTLIN option of PROC FORMAT.&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 26 Jul 2006 21:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1090#M1533</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2006-07-26T21:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve &lt;Name&gt; from a parameter constraint</title>
      <link>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1091#M1534</link>
      <description>If you are dead-set against formats, you could try this for the parameter definition:&lt;PRE&gt;Prompt: Please select a country&lt;BR /&gt;
&lt;BR /&gt;
SAS Variable Name: COUNTRY&lt;BR /&gt;
&lt;BR /&gt;
Display as:      Resolves to:&lt;BR /&gt;
United States    US:United States&lt;BR /&gt;
Italy            IT:Italy&lt;BR /&gt;
Ireland          EI:Ireland&lt;/PRE&gt;Instead of using COUNTRY directly in your SAS code, use these variables:&lt;PRE&gt;%let  RETURN_VALUE = %scan(&amp;amp;COUNTRY, 1, :);&lt;BR /&gt;
%let DISPLAY_VALUE = %scan(&amp;amp;COUNTRY, 2, :);&lt;/PRE&gt;It's not very elegant, but it should work.&lt;BR /&gt;
&lt;BR /&gt;
Vince&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Tue, 30 Jan 2007 20:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Retrieve-lt-Name-gt-from-a-parameter-constraint/m-p/1091#M1534</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2007-01-30T20:31:00Z</dc:date>
    </item>
  </channel>
</rss>

