<?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: Add calculation info into title statement before proc print in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615876#M180198</link>
    <description>&lt;P&gt;Create a macro variable from the dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noprint;
	create table summary&amp;amp;J.  as
	select  group,
            sum(Y) as SUM_Y 
	from  tbl&amp;amp;j.
	group by group
;
select model into :model from tbl&amp;amp;j.;
QUIT;
title "&amp;amp;model";&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Jan 2020 09:54:16 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-08T09:54:16Z</dc:date>
    <item>
      <title>Add calculation info into title statement before proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615871#M180193</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I create multiple simple summary reports .&lt;/P&gt;
&lt;P&gt;I want to write in the name of the model in the title statement of each report.&lt;/P&gt;
&lt;P&gt;So for first report it will be written "Model_mean"&lt;/P&gt;
&lt;P&gt;for 2nd report it will be written "Model_max"&lt;/P&gt;
&lt;P&gt;for 3rd report it will be written "Model_median"&lt;/P&gt;
&lt;P&gt;The name of the model (In title statement) should be taken automatically&amp;nbsp; from each row table(tbl1,tbl2,tbl3)&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;PRE&gt;&lt;CODE class=" language-sas"&gt;data tbl1;
INFILE DATALINES DLM=',';
input ID group $ Y Model $30.;
cards;
1,a,10,Model_mean
2,a,20,Model_mean
3,a,30,Model_mean
4,b,40,Model_mean
5,b,50,Model_mean
6,b,60,Model_mean
;
Run;


data tbl2;
INFILE DATALINES DLM=',';
input ID group $ Y Model $30.;
cards;
1,a,11,Model_max
2,a,21,Model_max
3,a,31,Model_max
4,b,41,Model_max
5,b,51,Model_max
6,b,61,Model_max
;
Run;



data tbl3;
INFILE DATALINES DLM=',';
input ID group $ Y Model $30.;
cards;
1,a,21,Model_median
2,a,31,Model_median
3,a,41,Model_median
4,b,51,Model_median
5,b,61,Model_median
6,b,71,Model_median
;
Run;


%macro RRR;
%do j=1 %to 3;
PROC SQL;
	create table summary&amp;amp;J.  as
	select  group,
            sum(Y) as SUM_Y 
	from  tbl&amp;amp;j.
	group by group
;
QUIT;
title "I want to write here the name of the model";
proc print data=summary&amp;amp;J. noobs;Run;
%end;
%mend RRR;
%RRR;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615871#M180193</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-08T09:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add calculation info into title statement before proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615876#M180198</link>
      <description>&lt;P&gt;Create a macro variable from the dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noprint;
	create table summary&amp;amp;J.  as
	select  group,
            sum(Y) as SUM_Y 
	from  tbl&amp;amp;j.
	group by group
;
select model into :model from tbl&amp;amp;j.;
QUIT;
title "&amp;amp;model";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615876#M180198</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-08T09:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add calculation info into title statement before proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615877#M180199</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro RRR;
%do j=1 %to 3;
PROC SQL noprint;
	create table summary&amp;amp;J.  as
	select  group,
            sum(Y) as SUM_Y 
	from  tbl&amp;amp;j.
	group by group
    ;
	select Model into :model from tbl&amp;amp;j. where monotonic()=1;
QUIT;
title "&amp;amp;model.";
proc print data=summary&amp;amp;J. noobs;Run;
%end;
%mend RRR;
%RRR;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615877#M180199</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2020-01-08T09:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add calculation info into title statement before proc print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615880#M180201</link>
      <description>&lt;P&gt;Thank you. It is working great&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 10:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-calculation-info-into-title-statement-before-proc-print/m-p/615880#M180201</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-08T10:28:59Z</dc:date>
    </item>
  </channel>
</rss>

