<?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: Setup multiple variables in stored process in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320844#M70727</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; Your code does not make sense. You have a MACRO definition inside the MERGE step, which is not typically how you define a Macro program. And, since you are defining the Macro program %REPORTS, I would expect you to have an invocation of %REPORTS someplace in your stored process. But I don't see that. The basic way to use Macro processing is to start with a working program and then Macro-tize the program and make a macro definition.&lt;BR /&gt;&lt;BR /&gt;Here's an older paper that outlines the process: &lt;A href="http://www2.sas.com/proceedings/forum2008/024-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/024-2008.pdf&lt;/A&gt; --this was before some of the newer capabilities of the prompting framework, but the basic process is still the same. Look at the&amp;nbsp; example on page 7, which shows the macro definition appearing first and then the Macro program is invoked inside the %stpbegin/%stpend.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 23:31:00 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-12-22T23:31:00Z</dc:date>
    <item>
      <title>Setup multiple variables in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320750#M70687</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stucked on how to setup a stored process to allow an Excell user to pick from the list. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;EM&gt;stpbegin&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* End EG generated code (do not edit this line) */&lt;/P&gt;&lt;P&gt;******************************************************************************************;&lt;/P&gt;&lt;P&gt;LIBNAME E '/sasdata';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; RPTO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET E.data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF MGMTLVL &amp;gt; ' ' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KEEP NAME MGR DBFN DBLN DBE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;SORT&lt;/STRONG&gt;; BY MGR ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; ALLTEMPS;&lt;/P&gt;&lt;P&gt;LENGTH CLASS $&lt;STRONG&gt;20&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;LENGTH UNTYPE $&lt;STRONG&gt;20&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET E.data;&lt;/P&gt;&lt;P&gt;IF CODE='R' THEN DELETE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KEEP NAME MGR CLASS ADDRES1 ADDRE2;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;SORT&lt;/STRONG&gt;; BY MGR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; MALL;&lt;/P&gt;&lt;P&gt;MERGE RPTO ALLTEMPS; BY MGRNO;&lt;/P&gt;&lt;P&gt;IF CLASS= ' ' || LEGNAME =' ' THEN DELETE;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;SORT&lt;/STRONG&gt;; BY EMPNO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;REPORTS&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%global status;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %IF &amp;amp;status = "B" %THEN %DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA AMALL; SET MALL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF CODE='B' THEN CLASS='B';&lt;/P&gt;&lt;P&gt;PROC SORT; BY NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT, ID NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;VAR MGR CLASS ADDRES1 ADDRES2 DBFN DBLN DBE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TITLE3 "B LIST";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%ELSE %IF &amp;amp;status = "C" %THEN %DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA NBTEMPS; SET MALL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF CODE='C' THEN CLASS='C';&lt;/P&gt;&lt;P&gt;PROC SORT; BY NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT, ID NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;VAR MGR CLASS ADDRES1 ADDRES2 DBFN DBLN DBE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TITLE3 "C LIST";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%ELSE %IF &amp;amp;status = "D" %THEN %DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA BARGTEMPS; SET MALL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF CODE='D' THEN CLASS='D';&lt;/P&gt;&lt;P&gt;PROC SORT; BY NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT, ID NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;VAR MGR CLASS ADDRES1 ADDRES2 DBFN DBLN DBE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TITLE3 "D LIST";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt; reports;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%STPEND;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 15:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320750#M70687</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2016-12-22T15:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setup multiple variables in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320803#M70709</link>
      <description>Hi:&lt;BR /&gt;  You need to use the prompting framework (assuming you are using the SAS Add-in for Microsoft Office), then if you design and define the stored process prompts correctly, when the Excel user runs the stored process, the prompting framework will put up a dialogue box with the drop down list (or the widget you choose) for the user to select from.&lt;BR /&gt; &lt;BR /&gt;You'll have to look in the Stored Process Developer's Guide for more help. The Base SAS Programming forum is probably not the place for this post. There is a separate forum for Stored Processes under the Business Intelligence area.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Thu, 22 Dec 2016 19:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320803#M70709</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-12-22T19:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Setup multiple variables in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320838#M70724</link>
      <description>&lt;P&gt;Thank you for the repsone and yes I am using the SAS add-in for Microsoft.&amp;nbsp; The old program was working fine until I added the merge data step.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 22:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320838#M70724</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2016-12-22T22:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Setup multiple variables in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320844#M70727</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; Your code does not make sense. You have a MACRO definition inside the MERGE step, which is not typically how you define a Macro program. And, since you are defining the Macro program %REPORTS, I would expect you to have an invocation of %REPORTS someplace in your stored process. But I don't see that. The basic way to use Macro processing is to start with a working program and then Macro-tize the program and make a macro definition.&lt;BR /&gt;&lt;BR /&gt;Here's an older paper that outlines the process: &lt;A href="http://www2.sas.com/proceedings/forum2008/024-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/024-2008.pdf&lt;/A&gt; --this was before some of the newer capabilities of the prompting framework, but the basic process is still the same. Look at the&amp;nbsp; example on page 7, which shows the macro definition appearing first and then the Macro program is invoked inside the %stpbegin/%stpend.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 23:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setup-multiple-variables-in-stored-process/m-p/320844#M70727</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-12-22T23:31:00Z</dc:date>
    </item>
  </channel>
</rss>

