<?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: Macro-change value of paraemter in title to another value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452338#M114149</link>
    <description>&lt;P&gt;Luckily, this is easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unluckily, the best way to do it depends highly on what you have coded so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show what your macro code (and macro calls) look like without a TITLE statement.&amp;nbsp; If you have an otherwise-working macro, inserting the TITLE statement will be easy.&amp;nbsp; But if your macro code doesn't work, even without a TITLE statement, you have to fix that first.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Apr 2018 16:41:44 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-04-08T16:41:44Z</dc:date>
    <item>
      <title>Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452324#M114141</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a parameter that get values : a,b,c,d,e&lt;/P&gt;&lt;P&gt;I have proc print that run on tables: &amp;nbsp;tbl_a &amp;nbsp;, &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;tbl_b &amp;nbsp; ,tbl_c, &amp;nbsp; tbl_d, &amp;nbsp; tbl_e&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And in each report there is a title statement &amp;nbsp;(Title "&amp;amp;Param.")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My request :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each time that value "a" &amp;nbsp;is on title of proc print I want to write "Group1".&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Each time that value "b" &amp;nbsp;is on title of proc print I want to write "Group2".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Each time that value "c" &amp;nbsp;is on title of proc print I want to write "Group3".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Each time that value "d" &amp;nbsp;is on title of proc print I want to write "Group4".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Each time that value "e" &amp;nbsp;is on title of proc print I want to write "Group5".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I do it please&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 14:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452324#M114141</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-08T14:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452331#M114143</link>
      <description>&lt;P&gt;It sure feels like you left something out of the explanation here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A macro that knows a is the first letter of the alphabet and so it replaces a with group1&lt;/P&gt;
&lt;P&gt;and it knows that b is the second letter of the alphabet and so it replaces b with group2&lt;/P&gt;
&lt;P&gt;and it knows that m is the 13th letter of the alphabet and so it replaces m with group13&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or do you mean something else? (please explain in a lot more detail)&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 15:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452331#M114143</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-08T15:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452333#M114144</link>
      <description>&lt;P&gt;The most simple way is to assign 2 macro variables&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; when mac1 = a then mac2 = Group2&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 16:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452333#M114144</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-08T16:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452338#M114149</link>
      <description>&lt;P&gt;Luckily, this is easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unluckily, the best way to do it depends highly on what you have coded so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show what your macro code (and macro calls) look like without a TITLE statement.&amp;nbsp; If you have an otherwise-working macro, inserting the TITLE statement will be easy.&amp;nbsp; But if your macro code doesn't work, even without a TITLE statement, you have to fix that first.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 16:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452338#M114149</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-08T16:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452339#M114150</link>
      <description>&lt;P&gt;I am at home so dont have SAS but i will write an example to simple code and what I need.&lt;/P&gt;&lt;P&gt;In the code you can see a statement&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Title “&amp;amp;param1.”;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want that instead of written&amp;nbsp;&lt;SPAN&gt;’a’&amp;nbsp; to be written '0-20'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want that instead of written&amp;nbsp;’b’&amp;nbsp; to be written '20-40'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want that instead of written&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;’&lt;/SPAN&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN&gt;’&amp;nbsp; to be written '&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;0+'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data tbl;&lt;/P&gt;&lt;P&gt;input&amp;nbsp; x&amp;nbsp; y;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;10&lt;/P&gt;&lt;P&gt;2 &amp;nbsp;15&lt;/P&gt;&lt;P&gt;3 &amp;nbsp;30&lt;/P&gt;&lt;P&gt;4 &amp;nbsp;40&lt;/P&gt;&lt;P&gt;5 &amp;nbsp;50&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data tbl2;&lt;/P&gt;&lt;P&gt;Set tbl1;&lt;/P&gt;&lt;P&gt;IF y&amp;lt;=20 then Ind=’a’;&lt;/P&gt;&lt;P&gt;Else If y&amp;gt;20 and y&amp;lt;=40 then Ind=’b’;&lt;/P&gt;&lt;P&gt;Else If y&amp;gt;40 then Ind=’c’;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let vector=a+b+c;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;%do&amp;nbsp;i=1&amp;nbsp;%to&amp;nbsp;3;&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;param1 =&amp;nbsp;%scan(&amp;amp;vector,i,+);&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;Create table&amp;nbsp; Summarry_&amp;amp;param1.&amp;nbsp; AS&lt;/P&gt;&lt;P&gt;SELECT &amp;nbsp;count(*)&amp;nbsp; as NoObs&lt;/P&gt;&lt;P&gt;FROM tbl2&lt;/P&gt;&lt;P&gt;&amp;nbsp;WHERE &amp;nbsp;Ind=&amp;amp;param1.&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;Title “&amp;amp;param1.”;&lt;/P&gt;&lt;P&gt;Proc print data= Summarry_&amp;amp;param1.&amp;nbsp; &amp;nbsp;&amp;nbsp;Noobs;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 16:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452339#M114150</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-08T16:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452352#M114152</link>
      <description>You can set up an account under SAS Academics on Demand (Independent Learner) to get access to a cloud version of SAS.</description>
      <pubDate>Sun, 08 Apr 2018 18:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452352#M114152</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-08T18:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452353#M114153</link>
      <description>&lt;P&gt;Some approaches:&lt;/P&gt;
&lt;P&gt;1. A whole bunch of %IF/%THEN statements&lt;/P&gt;
&lt;P&gt;2. A user defined format and apply it using %SYSFUNC&lt;/P&gt;
&lt;P&gt;3. Manually set another set of macro variables that line with the same index.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 18:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452353#M114153</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-08T18:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452358#M114154</link>
      <description>&lt;P&gt;Given this structure to the program, I would replace the existing TITLE statement with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Title&lt;/P&gt;
&lt;P&gt;%if &amp;amp;param=a %then '0-20';&lt;/P&gt;
&lt;P&gt;%else %if &amp;amp;param=b %then '20-40';&lt;/P&gt;
&lt;P&gt;%else %if &amp;amp;param=c %then '40+';&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a limited number of values, %IF/THEN handles it well.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 20:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452358#M114154</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-08T20:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452361#M114156</link>
      <description>&lt;P&gt;I agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very easy to do, as he has shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I don't understand about the original question, which you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt; really haven't explained, is do you have a maximum of three possibilites, a b and c, or could the list be much much longer in which case the solution by @Astounding becomes cumbersome. So, @Ronein, please clear this up for us. The better information you give us, the better solutions you will get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And please answer my original question, do you want the macro to realize that b is the second letter of the alphabet, and hence you get the second item in sequence in the title?????? Or not? These are very different situations. We can't advise you unless we know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, depending on your answer, I could envision a situation where macros ARE NOT NEEDED, and a much simpler solution is available, using BY groups in the analysis and the #Byval construct in your title. Again, let me repeat ... you MAY NOT NEED macros. There may be a MUCH SIMPLER solution. Please please please explain.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 21:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452361#M114156</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-08T21:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452404#M114181</link>
      <description>Hello&lt;BR /&gt;I just gave a simple example.&lt;BR /&gt;In reality it was more complicated.&lt;BR /&gt;The task is to change parameter value in title statement.&lt;BR /&gt;I have received an amswer to use if then statement within title statement.&lt;BR /&gt;Thank you so much&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Apr 2018 04:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452404#M114181</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-09T04:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452420#M114185</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Your code is not working I think.&lt;/P&gt;&lt;P&gt;Also after title statement should have quotes " " &amp;nbsp;and you dont have it in your code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 07:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452420#M114185</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-09T07:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-change value of paraemter in title to another value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452520#M114217</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Your code is not working I think.&lt;/P&gt;
&lt;P&gt;Also after title statement should have quotes " " &amp;nbsp;and you dont have it in your code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ron&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"is not working " is awful vague. And which code???&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 15:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-change-value-of-paraemter-in-title-to-another-value/m-p/452520#M114217</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-09T15:13:14Z</dc:date>
    </item>
  </channel>
</rss>

