<?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: Creating a drop down list that can be modified in a macro call in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868436#M343058</link>
    <description>&lt;P&gt;Appreciated as always&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 11:13:43 GMT</pubDate>
    <dc:creator>smackerz1988</dc:creator>
    <dc:date>2023-04-06T11:13:43Z</dc:date>
    <item>
      <title>Creating a drop down list that can be modified in a macro call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868431#M343053</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a macro I am working on that requires a template list of texts/prompts that can be used and then subsequently modified based on what is required. so basically the macro call would be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro(text=" ");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I&amp;nbsp; want a drop down list that can be modified after text so something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro( text="Do this &amp;lt;insert instruction&amp;gt;"
             "Do that &amp;lt; insert instruction&amp;gt;"
             "Describe this &amp;lt;insert object&amp;gt;");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I see there is custom tasks in SAS Studio or insert prompt and SAS EG but the issue I'm having is that you store the list in a macro and then add it to the macro. However I have to run it and then select the pre-populated values.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro(text=&amp;amp;list.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Is there a way I can just bring up the template values that I can modify prior to running the macro or is that functionality not currently possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 10:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868431#M343053</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2023-04-06T10:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a drop down list that can be modified in a macro call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868433#M343055</link>
      <description>&lt;P&gt;1) why you will need a drop down list if you are going to use it like that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;%macro(text=&amp;amp;list.);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) maybe macro design with testing + minoperator can do the job:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(parameter)/minoperator;

  %if %superq(PARAMETER) = %then
    %do;
      %put NOTE: This is a help info form macro &amp;amp;sysmacroname.;
      %put NOTE- The PARAMETER parameter allows only the following;
      %put NOTE- list of values:; 
      %put NOTE- Aaa;
      %put NOTE- Bbb;
      %put NOTE- Ccc;
    %goto EndOfMacro;
    %end;

  %if NOT (%superq(PARAMETER) in (Aaa Bbb Ccc)) %then
    %do;
      %put ERROR: The PARAMETER parameter has bad value!;
      %test()
    %goto EndOfMacro;
    %end;


  data &amp;amp;PARAMETER;
    set sashelp.class;
  run;


%EndOfMacro:
%mend test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 10:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868433#M343055</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-06T10:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a drop down list that can be modified in a macro call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868434#M343056</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;Okay full context I want to use it to create SAS specific template list of prompts for a ChatGPT Macro to use within SAS to get the most efficiency (or attempt to) so I wanted to create prompts such as this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"I want you to act as a code explainer in SAS. I don't understand this function. Can you please explain what it does, and provide an example? {Insert Code}" so you could ask PROC FCMP or PROC HTTP&lt;BR /&gt;"I want you to act as a code optimizer in SAS. {Describe problem with current code, if possible}. Can you make the code {cleaner/more efficient/run faster/more readable}? {Insert Code}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So a user can choose from a drop down list (albeit a partially modifiable drop down list)&amp;nbsp; and then modify/tailor based on their particular issue/requirements&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868434#M343056</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2023-04-06T11:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a drop down list that can be modified in a macro call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868435#M343057</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(parameter,insert_code)/minoperator;

  %if %superq(PARAMETER) = %then
    %do;
      %put NOTE: This is a help info form macro &amp;amp;sysmacroname.;
      %put NOTE- The PARAMETER parameter allows only the below;
      %put NOTE- list of values for actions:; 
      %put NOTE- `explain` for: "I want you to act as a code explainer in SAS. I don't understand this function. Can you please explain what it does, and provide an example? {Insert Code}";
      %put NOTE-;
      %put NOTE- `optimize` for "I want you to act as a code optimizer in SAS. {Describe problem with current code, if possible}. Can you make the code {cleaner/more efficient/run faster/more readable}? {Insert Code}";
    %goto EndOfMacro;
    %end;

  %if NOT (%superq(PARAMETER) in (explain optimize)) %then
    %do;
      %put ERROR: The PARAMETER parameter has bad value!;
      %test()
    %goto EndOfMacro;
    %end;


%put THE CODE: %superq(insert_code);


%EndOfMacro:
%mend test;

%test()

%test(explain, (data test123; set sashelp.class; do i=1,2,3; put i; end; run;))

%test(blabla)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868435#M343057</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-06T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a drop down list that can be modified in a macro call</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868436#M343058</link>
      <description>&lt;P&gt;Appreciated as always&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-drop-down-list-that-can-be-modified-in-a-macro-call/m-p/868436#M343058</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2023-04-06T11:13:43Z</dc:date>
    </item>
  </channel>
</rss>

