<?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: Setting a Text Prompt to an initial value based on a macro variable in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53935#M2996</link>
    <description>Is this for SAS 9.1 or SAS 9.2?&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
    <pubDate>Wed, 22 Dec 2010 17:09:35 GMT</pubDate>
    <dc:creator>Vince_SAS</dc:creator>
    <dc:date>2010-12-22T17:09:35Z</dc:date>
    <item>
      <title>Setting a Text Prompt to an initial value based on a macro variable</title>
      <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53934#M2995</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have a stored process presented to it's users via the portal (IDP).  One of the prompts is for a SAS/Connect userid (which is generally the same as the users portal login and therefore available via the _USERNAME reserved macro variable in the STP server on execution.)&lt;BR /&gt;
&lt;BR /&gt;
Is there any way to assign an initial value to a text prompt in a stored process using the _USERNAME macro var? (or any macro var?)  I've tried using a %let to assign the prompt macro var the value of _USERNAME as well as &amp;amp;_USERNAME in the default value of the prompt properties to no avail.&lt;BR /&gt;
&lt;BR /&gt;
I could create a dataset in metadata with one var/one row and use that to populate a default value at the beginning of the stored process but that seems over-complicated to me.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions/comments appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Graham.</description>
      <pubDate>Wed, 22 Dec 2010 15:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53934#M2995</guid>
      <dc:creator>webminer</dc:creator>
      <dc:date>2010-12-22T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a Text Prompt to an initial value based on a macro variable</title>
      <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53935#M2996</link>
      <description>Is this for SAS 9.1 or SAS 9.2?&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Wed, 22 Dec 2010 17:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53935#M2996</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2010-12-22T17:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a Text Prompt to an initial value based on a macro variable</title>
      <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53936#M2997</link>
      <description>It's 9.2 ....</description>
      <pubDate>Thu, 23 Dec 2010 07:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53936#M2997</guid>
      <dc:creator>webminer</dc:creator>
      <dc:date>2010-12-23T07:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a Text Prompt to an initial value based on a macro variable</title>
      <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53937#M2998</link>
      <description>I tried to do this using a dynamic prompt, but was unable to get it to work.&lt;BR /&gt;
&lt;BR /&gt;
Another possible solution is to build a prompt page yourself, but note that this will only work if the stored process is executed using the SAS Information Delivery Portal or the SAS Stored Process Web Application.&lt;BR /&gt;
&lt;BR /&gt;
The technique involves executing a stored process that writes the HTML-based prompt to _WEBOUT.  Below is a snippet of code to get you started.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
file _webout;&lt;BR /&gt;
put '&lt;FORM action=" &amp;quot;&amp;quot;&amp;quot;&amp;amp;_URL&amp;quot;&amp;quot;&amp;quot; " target="_mystp"&gt;';&lt;BR /&gt;
put '&lt;INPUT type="hidden" name="_program" value="&amp;lt;i&amp;gt;your-STP-here&amp;lt;/i&amp;gt;" /&gt;';&lt;BR /&gt;
put 'Enter your SAS/CONNECT userid:';&lt;BR /&gt;
put '&lt;INPUT type="text" name="connect_id" value=" &amp;quot;&amp;quot;&amp;quot;&amp;amp;_USERNAME&amp;quot;&amp;quot;&amp;quot; " /&gt;';&lt;BR /&gt;
put '&amp;lt;br&amp;gt;';&lt;BR /&gt;
put '&lt;INPUT type="submit" value="Run" /&gt;';&lt;BR /&gt;
put '&lt;/FORM&gt;';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Fri, 24 Dec 2010 15:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53937#M2998</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2010-12-24T15:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a Text Prompt to an initial value based on a macro variable</title>
      <link>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53938#M2999</link>
      <description>Thanks for your help, Vince.  I was kind of hoping that you'd tell me that there was some kind of trick to force it to be recognised .... Never mind.  Perhaps this could get added to the developers' New Year 'To Do List' ?! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;
&lt;BR /&gt;
Thanks for the snippet of code to get started down the other path, though.  &lt;BR /&gt;
&lt;BR /&gt;
All the best for the holiday season and a good New Year when it comes,&lt;BR /&gt;
&lt;BR /&gt;
Graham.</description>
      <pubDate>Wed, 29 Dec 2010 09:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Setting-a-Text-Prompt-to-an-initial-value-based-on-a-macro/m-p/53938#M2999</guid>
      <dc:creator>webminer</dc:creator>
      <dc:date>2010-12-29T09:03:01Z</dc:date>
    </item>
  </channel>
</rss>

