<?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 How to use a macro created using proc SQL and using it  in ODS text statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-macro-created-using-proc-SQL-and-using-it-in-ODS/m-p/863383#M341057</link>
    <description>&lt;P&gt;I have created two macros using PROC SQL from a table attached as follows&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table March_Quarter_Begin as&lt;BR /&gt;select March as MarchStart from prototype&lt;BR /&gt;where Milestone = 'Quarter_Start';&lt;BR /&gt;select cats('',put(MarchStart,WORDDATX19.),'') into : Kotara_start from March_Quarter_begin;&lt;BR /&gt;quit;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table March_Quarter_end as&lt;BR /&gt;select March as MarchEnd from prototype&lt;BR /&gt;where Milestone = 'Quarter_Stop';&lt;BR /&gt;select cats('',put(MarchEnd,WORDDATX19.),'') into : Kotara_end from March_Quarter_end;&lt;BR /&gt;quit;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then created a pdf report using the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods pdf file = "&amp;amp;TMC_Report\Weekly_TMC_Performance_Report.pdf_file" notoc;&lt;BR /&gt;ods text = "Quarter performance: &amp;amp;Kotara_start to &amp;amp;Kotara_end";&lt;BR /&gt;Proc report data=Prototype;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;The results are in the pdf file attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that the dates are showing on two rows instead of a single row in the report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something I am not doing correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please assist?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;MMohotsi&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>Fri, 10 Mar 2023 08:41:29 GMT</pubDate>
    <dc:creator>mmohotsi</dc:creator>
    <dc:date>2023-03-10T08:41:29Z</dc:date>
    <item>
      <title>How to use a macro created using proc SQL and using it  in ODS text statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-macro-created-using-proc-SQL-and-using-it-in-ODS/m-p/863383#M341057</link>
      <description>&lt;P&gt;I have created two macros using PROC SQL from a table attached as follows&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table March_Quarter_Begin as&lt;BR /&gt;select March as MarchStart from prototype&lt;BR /&gt;where Milestone = 'Quarter_Start';&lt;BR /&gt;select cats('',put(MarchStart,WORDDATX19.),'') into : Kotara_start from March_Quarter_begin;&lt;BR /&gt;quit;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table March_Quarter_end as&lt;BR /&gt;select March as MarchEnd from prototype&lt;BR /&gt;where Milestone = 'Quarter_Stop';&lt;BR /&gt;select cats('',put(MarchEnd,WORDDATX19.),'') into : Kotara_end from March_Quarter_end;&lt;BR /&gt;quit;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then created a pdf report using the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods pdf file = "&amp;amp;TMC_Report\Weekly_TMC_Performance_Report.pdf_file" notoc;&lt;BR /&gt;ods text = "Quarter performance: &amp;amp;Kotara_start to &amp;amp;Kotara_end";&lt;BR /&gt;Proc report data=Prototype;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;The results are in the pdf file attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that the dates are showing on two rows instead of a single row in the report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something I am not doing correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please assist?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;MMohotsi&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>Fri, 10 Mar 2023 08:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-macro-created-using-proc-SQL-and-using-it-in-ODS/m-p/863383#M341057</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2023-03-10T08:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a macro created using proc SQL and using it  in ODS text statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-macro-created-using-proc-SQL-and-using-it-in-ODS/m-p/863389#M341059</link>
      <description>&lt;P&gt;To me it looks like the title may be too long for the margin/page settings you have in your report. I think that is because CATS normally returns a result of length 200, you can use the TRIMMED options to ret rid of trailing blanks:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select cats('',put(MarchStart,WORDDATX19.),'') into : Kotara_start TRIMMED from March_Quarter_begin;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2023 09:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-macro-created-using-proc-SQL-and-using-it-in-ODS/m-p/863389#M341059</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-03-10T09:04:17Z</dc:date>
    </item>
  </channel>
</rss>

