<?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: ODS PDF, Proc Report startpage=no in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/418009#M19940</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The easiest way to insert a pseudo-title at the top of a procedure when you have STARTPAGE=NO is to use ODS TEXT. Since you did not post any data, I used SASHELP files and simplified the basic program to illustrate the ODS TEXT technique. The second approach would be to use a COMPUTE BEFORE _PAGE_ with PROC REPORT, but I recommend the ODS TEXT method first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);

proc template;
  define style styles.utext;
  parent=styles.pearl;
  class usertext from SystemTitle /
       textalign=center;
  end;
run;
  
ods pdf file='c:\temp\test1.pdf' startpage=no style=styles.utext;
title 'First Report';
proc report data=sashelp.class(obs=5);
run;
  
ods text='Second Report';
proc report data=sashelp.shoes(obs=5);
run;
ods pdf close;
title;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 03 Dec 2017 15:46:32 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-12-03T15:46:32Z</dc:date>
    <item>
      <title>ODS PDF, Proc Report startpage=no</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/417989#M19938</link>
      <description>&lt;P&gt;Hi, I want to get multiple tables per page, but each with a distinct title1(variable) and title2(month) - not just a title at the top of the page, but one for each table in the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROBLEM: Using startpage=no I get one good title at the top of each page with the first output table, however, the following tables do not have a distinct title (nothing infact).&amp;nbsp; I use a proc a sql statement for the outer loop, to cycle through each variable. Then, the inner loop cycles through time periods on each var by month.&amp;nbsp; The print statement is defined in the outer loop because I want one pdf per variable that would contain multiple tables - one for each time period.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I modify the proc report statement so the I get a fresh title for each table in the inner loop.&amp;nbsp; Or, am I just plain wrong about this approach all together?&amp;nbsp; Thank you for any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro pdf(cp,yr,year);&lt;/P&gt;
&lt;P&gt;proc sql noprint;select distinct mem3, mm into :cclist separated by ' '&lt;BR /&gt;from dat.xyz where varname1 in ("&amp;amp;cp") order by varname1, mm;&lt;/P&gt;
&lt;P&gt;%let n_cclist= &amp;amp;sqlobs; quit;&lt;/P&gt;
&lt;P&gt;%let j=1; %let cc=%scan(&amp;amp;cclist,&amp;amp;j,%str( ));&lt;BR /&gt;%do %while(%qscan(&amp;amp;cclist,&amp;amp;j,%STR( )) NE );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options missing='' nodate nonumber orientation=portrait ;&lt;BR /&gt;ODS LISTING ;&lt;BR /&gt;ods pdf file="H:\Shared\MDSEIMB\SFDS\SDS\Green Book\PDF\&amp;amp;cc._&amp;amp;yr..pdf" startpage=no;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;proc sql noprint;select distinct Varname1, MM, SV, ESTIM, ESTIM2, Varname2, Month,&lt;BR /&gt;cem, cem2, cem3 into &lt;BR /&gt;:vxlist separated by ' ', &lt;BR /&gt;:mxlist separated by ' ',&lt;BR /&gt;:svlist separated by ' ',&lt;BR /&gt;:eslist separated by ' ',&lt;BR /&gt;:e2list separated by ' ',&lt;BR /&gt;:v2list separated by ' ',&lt;BR /&gt;:mhlist separated by ' ',&lt;BR /&gt;:crlist separated by ' ',&lt;BR /&gt;:c2list separated by ' ',&lt;BR /&gt;:c3list separated by ' '&lt;BR /&gt;from dat.xyz where varname1 in ("&amp;amp;cp") order by varname1, mm;&lt;/P&gt;
&lt;P&gt;%let n_vxlist= &amp;amp;sqlobs; quit;&lt;/P&gt;
&lt;P&gt;%let v=1; %let vx=%scan(&amp;amp;vxlist,&amp;amp;v.,%str( ));&lt;BR /&gt;%let m=1; %let mx=%scan(&amp;amp;mxlist,&amp;amp;m.,%str( ));&lt;BR /&gt;%let s=1; %let sv=%scan(&amp;amp;svlist,&amp;amp;s.,%str( ));&lt;BR /&gt;%let e=1; %let es=%scan(&amp;amp;eslist,&amp;amp;e.,%str( ));&lt;BR /&gt;%let f=1; %let e2=%scan(&amp;amp;e2list,&amp;amp;f.,%str( ));&lt;BR /&gt;%let w=1; %let v2=%scan(&amp;amp;v2list,&amp;amp;w.,%str( ));&lt;BR /&gt;%let h=1; %let mh=%scan(&amp;amp;mhlist,&amp;amp;h.,%str( ));&lt;BR /&gt;%let c=1; %let cr=%scan(&amp;amp;crlist,&amp;amp;c.,%str( ));&lt;BR /&gt;%let x=1; %let c2=%scan(&amp;amp;c2list,&amp;amp;x.,%str( ));&lt;BR /&gt;%let y=1; %let c3=%qscan(&amp;amp;c3list,&amp;amp;y.,%str( ));&lt;/P&gt;
&lt;P&gt;%do %while(%scan(&amp;amp;vxlist,&amp;amp;v,%STR( )) NE );&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc report nowindows data=pdfd.&amp;amp;sv._&amp;amp;vx._&amp;amp;yr.&amp;amp;mx. SPLIT='*' ls=120 &lt;BR /&gt;style(report)={rules=none frame=void cellspacing=0 cellpadding=3&lt;BR /&gt; borderwidth=0.3 borderleftwidth=0.3 borderrightwidth=0.3 } &lt;BR /&gt;style(column)={cellheight=0.175in font_face=Arial font_size=0.5 }&lt;BR /&gt;style(header)={font_face=Arial cellheight=0.40in font_size=0.5&lt;BR /&gt; bordertopcolor=black borderbottomcolor=black &lt;BR /&gt; borderbottomwidth=0.3 backgroundcolor=white };&lt;BR /&gt;title1 height=1 justify=center font=Arial &amp;amp;c2 ;/*Commodity name*/&lt;BR /&gt;title2 height=1 justify=center font=Arial "&amp;amp;mh &amp;amp;year. - J";&lt;/P&gt;
&lt;P&gt;columns _ST2 tcv LSS NLS MFT LPC NPC LS_C NL_C MF_C&amp;nbsp;RES LSP NLP;&lt;BR /&gt;define _ST2 / ' STX' left &lt;BR /&gt; style(column)={cellwidth=0.5in borderrightcolor=black borderrightwidth=0.3 indent=6};&lt;BR /&gt;define tcv / style(column)={cellwidth=0.5in} display format=comma4.1 'KCV' right ;&lt;BR /&gt;define LSS / style(column)={cellwidth=0.5in} display format=comma. 'XML' right;&lt;BR /&gt;define NLS / style(column)={cellwidth=0.5in} display format=comma. 'MOL' right;&lt;BR /&gt;define MFT / style(column)={cellwidth=0.7in} display format=comma14. 'MFX' right;&lt;BR /&gt;define LPC / style(column)={cellwidth=0.7in} display format=comma5.1 'PTEL' right;&lt;BR /&gt;define NPC / style(column)={cellwidth=0.7in} display format=comma4.1 'PTEN' right;&lt;BR /&gt;define LS_C / style(column)={cellwidth=0.5in} display format=comma4.1 'LCV' right;&lt;BR /&gt;define NL_C / style(column)={cellwidth=0.5in} display format=comma4.1 'NCV' right;&lt;BR /&gt;define MF_C / style(column)={cellwidth=0.5in} display format=comma4.1 'MCV' right;&lt;BR /&gt;define RES / style(column)={cellwidth=0.6in} display format=comma4.1 'RR' right;&lt;BR /&gt;define LSP / style(column)={cellwidth=0.6in} display format=comma. 'LUPs' right;&lt;BR /&gt;define NLP/ display format=comma. 'NUPs' right&lt;BR /&gt; style(column)={cellwidth=0.6in borderrightcolor=black};&lt;/P&gt;
&lt;P&gt;compute MF_C; if TCV&amp;gt;0 and MF_C gt TCV then call define('MF_C','style',&lt;BR /&gt; 'style={background=LIME}'); &lt;BR /&gt;endcomp;&lt;/P&gt;
&lt;P&gt;compute _ST2;if trim(_ST2) = 'U.S.' then call define(_row_,'style',&lt;BR /&gt; 'style=[bordertopcolor=black borderbottomcolor=black&lt;BR /&gt; bordertopwidth=0.3 ]');&lt;BR /&gt;endcomp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%let v=%eval(&amp;amp;v+1); %let vx=%scan(&amp;amp;vxlist,&amp;amp;v.,%str( ));&lt;BR /&gt;%let m=%eval(&amp;amp;m+1); %let mx=%scan(&amp;amp;mxlist,&amp;amp;m.,%str( ));&lt;BR /&gt;%let s=%eval(&amp;amp;s+1); %let sv=%scan(&amp;amp;svlist,&amp;amp;s.,%str( ));&lt;BR /&gt;%let e=%eval(&amp;amp;e+1); %let es=%scan(&amp;amp;eslist,&amp;amp;e.,%str( ));&lt;BR /&gt;%let f=%eval(&amp;amp;f+1); %let e2=%scan(&amp;amp;e2list,&amp;amp;f.,%str( ));&lt;BR /&gt;%let w=%eval(&amp;amp;w+1); %let v2=%scan(&amp;amp;v2list,&amp;amp;w.,%str( ));&lt;BR /&gt;%let h=%eval(&amp;amp;h+1); %let mh=%scan(&amp;amp;mhlist,&amp;amp;h.,%str( ));&lt;BR /&gt;%let c=%eval(&amp;amp;c+1); %let cr=%scan(&amp;amp;crlist,&amp;amp;c.,%str( ));&lt;BR /&gt;%let x=%eval(&amp;amp;x+1); %let c2=%scan(&amp;amp;c2list,&amp;amp;x.,%str( ));&lt;BR /&gt;%let y=%eval(&amp;amp;y+1); %let c3=%qscan(&amp;amp;c3list,&amp;amp;y.,%str( ));&lt;/P&gt;
&lt;P&gt;%end;&lt;BR /&gt;ODS _ALL_ CLOSE;&lt;BR /&gt;ODS LISTING;&lt;/P&gt;
&lt;P&gt;%let j=%eval(&amp;amp;j+1); %let cc=%qscan(&amp;amp;cclist,&amp;amp;j.,%str( ));&lt;BR /&gt;%end;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;%mend;&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>Sun, 03 Dec 2017 05:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/417989#M19938</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2017-12-03T05:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF, Proc Report startpage=no</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/418009#M19940</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The easiest way to insert a pseudo-title at the top of a procedure when you have STARTPAGE=NO is to use ODS TEXT. Since you did not post any data, I used SASHELP files and simplified the basic program to illustrate the ODS TEXT technique. The second approach would be to use a COMPUTE BEFORE _PAGE_ with PROC REPORT, but I recommend the ODS TEXT method first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);

proc template;
  define style styles.utext;
  parent=styles.pearl;
  class usertext from SystemTitle /
       textalign=center;
  end;
run;
  
ods pdf file='c:\temp\test1.pdf' startpage=no style=styles.utext;
title 'First Report';
proc report data=sashelp.class(obs=5);
run;
  
ods text='Second Report';
proc report data=sashelp.shoes(obs=5);
run;
ods pdf close;
title;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Dec 2017 15:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/418009#M19940</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-12-03T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF, Proc Report startpage=no</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/418574#M19951</link>
      <description>&lt;P class="cs95e872d0"&gt;&lt;SPAN class="cs78ab32121"&gt;Thank you Cynthia.&amp;nbsp; &amp;nbsp;I appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="cs95e872d0"&gt;&lt;SPAN class="cs78ab32121"&gt;I modified by moving the ODS PDF opening and closing statements.&amp;nbsp; I also ADDED and additional ODS PDF Startpage= statement just before the PROC REPORT with a couple of text lines as you suggested.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro pdf5(c3,yr,year);&lt;BR /&gt;proc sql noprint;select distinct cr3 into &lt;BR /&gt;:cclist separated by ' '&lt;BR /&gt;from dat.xyz where cr3 in ("&amp;amp;c3");&lt;/P&gt;
&lt;P&gt;%let n_cclist= &amp;amp;sqlobs; quit;&lt;BR /&gt;%put &amp;amp;cclist;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ODS LISTING close;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ods escapechar='^';&lt;/FONT&gt;&lt;BR /&gt;ods pdf file="H:\............\&amp;amp;c3._&amp;amp;yr..pdf" &lt;FONT color="#FF0000"&gt;startpage=yes;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let j=1; %let cc=%scan(&amp;amp;cclist,&amp;amp;j,%str( ));&lt;BR /&gt;%do %while(%scan(&amp;amp;cclist,&amp;amp;j,%STR( )) NE );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options missing='' nodate nonumber orientation=portrait ;&lt;BR /&gt;/*ODS LISTING close;*/&lt;BR /&gt;/*ods pdf file="H:\Shared\MDSEIMB\SFDS\SDS\Green Book\PDF\&amp;amp;cc._&amp;amp;yr..pdf" startpage=yes;*/&lt;/P&gt;
&lt;P&gt;proc sql noprint;select distinct Varname1......., ......., etc......., Varname10 into &lt;BR /&gt;:vxlist separated by ' ', &lt;BR /&gt;&lt;EM&gt;(lists 1 to 10. etc)&lt;/EM&gt;&lt;BR /&gt;:c3list separated by ' '&lt;BR /&gt;from dat.skinnyxy where crop3="&amp;amp;cc" order by varname1, mm;&lt;/P&gt;
&lt;P&gt;%let n_vxlist= &amp;amp;sqlobs; quit;&lt;/P&gt;
&lt;P&gt;%let v=1; %let vx=%scan(&amp;amp;vxlist,&amp;amp;v.,%str( ));&lt;/P&gt;
&lt;P&gt;..&lt;BR /&gt;&lt;EM&gt;(List of counter vars 1-10 ect)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;..&lt;BR /&gt;%let y=1; %let c3=%scan(&amp;amp;c3list,&amp;amp;y.,%str( ));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%do %while(%scan(&amp;amp;vxlist,&amp;amp;v,%STR( )) NE );&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ods pdf startpage=no;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ods pdf text='^n^n';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ods pdf text="^S={outputwidth=100% just=c} &amp;amp;mh &amp;amp;c2 &amp;amp;year";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc report nowindows data=pdfd.&amp;amp;sv._&amp;amp;vx._&amp;amp;yr.&amp;amp;mx. SPLIT='*' ls=120 &lt;BR /&gt;style(report)={rules=none frame=void cellspacing=0 cellpadding=3&lt;BR /&gt; borderwidth=0.3 borderleftwidth=0.3 borderrightwidth=0.3 } &lt;BR /&gt;style(column)={cellheight=0.175in font_face=Arial font_size=0.5 }&lt;BR /&gt;style(header)={font_face=Arial cellheight=0.40in font_size=0.5&lt;BR /&gt; bordertopcolor=black borderbottomcolor=black &lt;BR /&gt; borderbottomwidth=0.3 backgroundcolor=white };&lt;BR /&gt;title1 height=12pt justify=center font=Arial bold &amp;amp;c2;/*Commodity name*/&lt;BR /&gt;/*title2 height=1 justify=center font=Arial " &amp;amp;year. J";*/&lt;/P&gt;
&lt;P&gt;columns _var1-_varxx &lt;FONT color="#FF0000"&gt;(list the variables in the table);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;define _var1 / ' State' left &lt;BR /&gt; style(column)={cellwidth=0.5in borderrightcolor=black borderrightwidth=0.3 indent=6};&lt;BR /&gt;define var2 / style(column)={cellwidth=0.5in} display format=comma4.1 'Var description' right ;&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;etc&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;etc&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;(Define each variable name as you want it listed in the table.)&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;etc&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;define&amp;nbsp;varxx / display format=comma. 'varxx description' right&lt;BR /&gt; style(column)={cellwidth=0.6in borderrightcolor=black};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;%let v=%eval(&amp;amp;v+1); %let vx=%scan(&amp;amp;vxlist,&amp;amp;v.,%str( ));&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;etc&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;(List if counting variables)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;etc&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;%let y=%eval(&amp;amp;y+1); %let c3=%scan(&amp;amp;c3list,&amp;amp;y.,%str( ));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;%let j=%eval(&amp;amp;j+1); %let cc=%qscan(&amp;amp;cclist,&amp;amp;j.,%str( ));&lt;BR /&gt;%end;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ODS _ALL_ CLOSE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ODS LISTING;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-Spanrows-and-Row-height/td-p/117855*/" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-Spanrows-and-Row-height/td-p/117855*/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:57:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Proc-Report-startpage-no/m-p/418574#M19951</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2017-12-05T18:57:21Z</dc:date>
    </item>
  </channel>
</rss>

