<?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: PROC PRINT in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925054#M41517</link>
    <description>&lt;P&gt;The first proc print you show does not reference a data set to use.&lt;/P&gt;
&lt;P&gt;So it defaults to using the last data set created before that Print executes. Which might be Data_C.&lt;/P&gt;
&lt;PRE&gt;proc print;
title "Count:" &amp;amp;countofpop.;
quit;

proc print data=DATA_B;
title "Data B";
quit;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Apr 2024 18:44:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-04-19T18:44:16Z</dc:date>
    <item>
      <title>PROC PRINT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925052#M41516</link>
      <description>&lt;P&gt;I am creating an HTML file with results from different datasets. However, Data_C always shows up twice - once before the title where the output title is "Data B" and once at the end. How can I stop Data_C from showing up before Data B? TIA!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;as_of_date = today();&lt;BR /&gt;year=year(today());&lt;/P&gt;&lt;P&gt;call symput('as_of_date',"'" || put(as_of_date,mmddyy10.) || "'");&lt;BR /&gt;call symput('Year',compress(year));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;as_of_date;&lt;BR /&gt;%put &amp;amp;year;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(*) into: countofpop&lt;BR /&gt;from population;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;countofpop;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print;&lt;BR /&gt;title "Count:" &amp;amp;countofpop.;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=DATA_B;&lt;BR /&gt;title "Data B";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=Data_B;&lt;BR /&gt;var ColumnX;&lt;BR /&gt;title "Data B Column";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=Data_C;&lt;BR /&gt;title "Data C";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 18:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925052#M41516</guid>
      <dc:creator>Vinz867</dc:creator>
      <dc:date>2024-04-19T18:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PRINT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925054#M41517</link>
      <description>&lt;P&gt;The first proc print you show does not reference a data set to use.&lt;/P&gt;
&lt;P&gt;So it defaults to using the last data set created before that Print executes. Which might be Data_C.&lt;/P&gt;
&lt;PRE&gt;proc print;
title "Count:" &amp;amp;countofpop.;
quit;

proc print data=DATA_B;
title "Data B";
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Apr 2024 18:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925054#M41517</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-19T18:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PRINT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925055#M41518</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print;
title "Count:" &amp;amp;countofpop.;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will print the most recent data set (also no quit with a proc print, it's a run).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want that title you can use ODS TEXT= or multiple TITLE statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also recommend the quote function for adding quotes, though I question if those are actually needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
as_of_date = today();
year=year(today());

call symput('as_of_date', quote(put(as_of_date,mmddyy10.)) );
call symput('Year',compress(year));
run;

%put &amp;amp;as_of_date;
%put &amp;amp;year;


proc sql noprint;
select count(*) into: countofpop
from population;
quit;
%put &amp;amp;countofpop;



ods text= "Count:" &amp;amp;countofpop.;

title "Data B";
proc print data=DATA_B;
run;

 
title "Data B Column";
proc print data=Data_B;
var ColumnX;
run;

 
title "Data C";
proc print data=Data_C;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Apr 2024 18:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-PRINT/m-p/925055#M41518</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-04-19T18:45:25Z</dc:date>
    </item>
  </channel>
</rss>

