<?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: Prompt Help in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39238#M4720</link>
    <description>Thanks for your help! I cannot believe I made a mistake as simple as that in the program! Amateur mistake to make! &lt;BR /&gt;
&lt;BR /&gt;
The program runs just fine for the prompt Portfolio, but when I replace the prompt with MPANlist the following error is thrown up:&lt;BR /&gt;
&lt;BR /&gt;
"The open data operation failed. The following data error occurred.&lt;BR /&gt;
[error] File Work.Voltage.ID.Data does not exist."&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?</description>
    <pubDate>Thu, 25 Nov 2010 09:36:45 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-11-25T09:36:45Z</dc:date>
    <item>
      <title>Prompt Help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39236#M4718</link>
      <description>Hi there&lt;BR /&gt;
&lt;BR /&gt;
I am having problems using prompts in EG. I want to specify an if statement to do one of two things depending on a prompt. The prompt will be either "MPANlist" or "Portfolio". &lt;BR /&gt;
&lt;BR /&gt;
Plesae see code below. When I change the first line from "Portfolio" to "MPANlist" sas still ruuns the second if statement (which is for the prompt value"Portfolio")&lt;BR /&gt;
&lt;BR /&gt;
Please Help!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%let Process = "Portfolio";&lt;BR /&gt;
&lt;BR /&gt;
%macro Choose_Process;&lt;BR /&gt;
&lt;BR /&gt;
 %if $Process = "MPANList" %then %do;&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
   CREATE TABLE WORK.Voltage_ID AS &lt;BR /&gt;
   SELECT t1.MPANCORE2,&lt;BR /&gt;
 t1.LLF, &lt;BR /&gt;
t2.Voltage_ID,&lt;BR /&gt;
t1.Dist_ID2 &lt;BR /&gt;
FROM MPAN_IMPORT_DIST_ID_FORMAT AS t1, WORK.TX920_LOSSES_LOOKUP_FORMAT AS t2&lt;BR /&gt;
WHERE (t1.LLF = t2.LLF AND t1.Dist_ID2 = t2.DIST_ID);&lt;BR /&gt;
quit;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
%else %if &amp;amp;Process = "Portfolio" %then %do;&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
   CREATE TABLE WORK.Voltage_ID AS &lt;BR /&gt;
   SELECT t1.MPANCORE, &lt;BR /&gt;
 t1.Dist_ID2, &lt;BR /&gt;
 t1.LLF2, &lt;BR /&gt;
 t2.Voltage_ID as TEST&lt;BR /&gt;
FROM WORK.CALC_DIST_ID_FORMAT AS t1, WORK.TX920_LOSSES_LOOKUP_FORMAT AS t2&lt;BR /&gt;
WHERE (t1.LLF2 = t2.LLF AND t1.Dist_ID2 = t2.DIST_ID);&lt;BR /&gt;
QUIT;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
%mend Choose_Process;&lt;BR /&gt;
&lt;BR /&gt;
%Choose_Process&lt;BR /&gt;
Run;</description>
      <pubDate>Wed, 24 Nov 2010 17:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39236#M4718</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-24T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt Help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39237#M4719</link>
      <description>I think your code is just about right.&lt;BR /&gt;
&lt;BR /&gt;
A couple of changes:&lt;BR /&gt;
&lt;BR /&gt;
First of all, in your first %if statement change $Process to &amp;amp;Process&lt;BR /&gt;
&lt;BR /&gt;
Second, macro variables are different from SAS character variables. Usually, you don't put them in quotes. I'm not sure what your prompts will be like, but it is likely that the following statements will work better:&lt;BR /&gt;
&lt;BR /&gt;
%let Process = Portfolio;&lt;BR /&gt;
%if &amp;amp;Process = MPANList %then %do;&lt;BR /&gt;
%else %if &amp;amp;Process = Portfolio %then %do;&lt;BR /&gt;
&lt;BR /&gt;
Good luck!&lt;BR /&gt;
Tom</description>
      <pubDate>Thu, 25 Nov 2010 03:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39237#M4719</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2010-11-25T03:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt Help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39238#M4720</link>
      <description>Thanks for your help! I cannot believe I made a mistake as simple as that in the program! Amateur mistake to make! &lt;BR /&gt;
&lt;BR /&gt;
The program runs just fine for the prompt Portfolio, but when I replace the prompt with MPANlist the following error is thrown up:&lt;BR /&gt;
&lt;BR /&gt;
"The open data operation failed. The following data error occurred.&lt;BR /&gt;
[error] File Work.Voltage.ID.Data does not exist."&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?</description>
      <pubDate>Thu, 25 Nov 2010 09:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39238#M4720</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-25T09:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt Help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39239#M4721</link>
      <description>It's hard to know what this problem could be. In your post, the dataset name is Work.Voltage.ID.Data&lt;BR /&gt;
&lt;BR /&gt;
Are there periods in it, or underscores?</description>
      <pubDate>Sat, 27 Nov 2010 04:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Prompt-Help/m-p/39239#M4721</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2010-11-27T04:45:48Z</dc:date>
    </item>
  </channel>
</rss>

