<?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: Changing title statement based on condition in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169004#M43709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use call execute in your datastep. &lt;/P&gt;&lt;P&gt;data ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('title "'||strip(your title)||'";');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('proc print...');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 May 2014 11:06:43 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-05-22T11:06:43Z</dc:date>
    <item>
      <title>Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169003#M43708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anzone help me out how to change the title stement in the output window based on condition&lt;/P&gt;&lt;P&gt;ex:%global x d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let x=ccc;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let date=23may2014;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input var1 date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aaa 21may2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bbb 22may2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ccc 23may2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title "................";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Here i need if x=var1 and d=date then title="CCCCCCCCCCCCCCCCCCCCCC"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x ne var1 and d=date&amp;nbsp;&amp;nbsp; then title="BBBBBBBBBBBBBBBBBBBBB"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; x ne var1 and d ne date then title="VVVVVVVVVVVVVVVVV";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 11:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169003#M43708</guid>
      <dc:creator>rawindar</dc:creator>
      <dc:date>2014-05-22T11:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169004#M43709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use call execute in your datastep. &lt;/P&gt;&lt;P&gt;data ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('title "'||strip(your title)||'";');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('proc print...');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 11:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169004#M43709</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-22T11:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169005#M43710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you cannot change the title while proc print is running, and you placed the condition on values of the dataset &lt;EM&gt;to be printed&lt;/EM&gt;, your problem is unsolvable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 11:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169005#M43710</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-22T11:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169006#M43711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make a macro :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;

%global x d;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let x=ccc;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let date=23may2014;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let flag=N;
&amp;nbsp;&amp;nbsp;&amp;nbsp; data test;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input var1 $ date :$20.;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var1="&amp;amp;x" then call symputx('flag','Y');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aaa 21may2014
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bbb 22may2014
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ccc 23may2014
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;
 %macro m;&amp;nbsp; 
%if &amp;amp;flag eq Y %then %do; Title "YES.............."; %end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else %do;title "NO....";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;%end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;%mend m;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;%m
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 12:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169006#M43711</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-22T12:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169007#M43712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you do have to understand that you have three observations, but there can only be one title.&amp;nbsp; Assuming you work out which of the three observations determines the title ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a macro variable holding the title's text, instead of writing a macro.&amp;nbsp; Right before the DATALINES statement, add along these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1="&amp;amp;x" and d="&amp;amp;date" then call symput('text', 'CCCCCCCCCCCCCCCCCCCCCCC');&lt;/P&gt;&lt;P&gt;else if var1 ne "&amp;amp;x" and d="&amp;amp;date" then call symput('text', 'BBBBBBBBBBBBBBBBBBBBBBB');&lt;/P&gt;&lt;P&gt;else call symput('text', 'VVVVVVVVVVVVVVVVVVVVVVVVV');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then below, your TITLE statement simply becomes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title "&amp;amp;text";&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 15:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169007#M43712</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-05-22T15:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169008#M43713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The closest you might get is to create your "title" variable and then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;by title;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the version of SAS you are using there are options to modify the appearance of the By line that will appear before the printed data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 16:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169008#M43713</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-22T16:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169009#M43714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your response.I tried all above,espesially programs by Ksharp and Astounding It was executed successfullz without anz errors,But it did not give the expected resulz.Itäs not able to change the title statement.Could zou guide me more please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rawindarreddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 05:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169009#M43714</guid>
      <dc:creator>rawindar</dc:creator>
      <dc:date>2014-05-26T05:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169010#M43715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As was already stated, you CANNOT change the title during execution of a proc or data step. You can just try to simulate it.&lt;/P&gt;&lt;P&gt;One way to achieve the desired result is to generate the whole output manually with a data _null_ step. But this means you have to write the &lt;EM&gt;whole&lt;/EM&gt; report syntax in eg html. Which takes knowledge in css, html and the intricacies of the put statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 05:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169010#M43715</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-26T05:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169011#M43716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post an example of what your data looks like and EXACTLY what you expect to see as the output and we can help you get there. The way your question is currently phrased it won't work, however there may be other solutions, some easier than others to get what you want. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 17:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169011#M43716</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-26T17:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Changing title statement based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169012#M43717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to show more of your program.&amp;nbsp; What are all the details of your PROC PRINT?&amp;nbsp; What are you hoping will happen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 13:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-title-statement-based-on-condition/m-p/169012#M43717</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-05-27T13:28:38Z</dc:date>
    </item>
  </channel>
</rss>

