<?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: SAS Mainframe: Create multiple reports in one output file with Page break after each report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535750#M147148</link>
    <description>&lt;P&gt;You can try appending a form feed character (FF) using a DATA _NULL_ step after creating the output. I don't have ready access to a mainframe right now, but this SHOULD work.&lt;/P&gt;
&lt;P&gt;Try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myprint file="myuid.printer.flatfile" DISP=mod;
proc printto print=myprint new;
run;

title "Report 1";
proc print data=sashelp.class;
   where sex='F';
run;
proc printto;run;
/* Add the form feed: */
data _null_;
  file myprint mod;
  put _page_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Rather than use PROC PRINTTO, you might consider using ODS to write the output instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing file="myuid.printer.flatfile" DISP=mod;
title "Report 1";
proc print data=sashelp.class;
   where sex='F';
run;
ods listing close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I will say that Windows printers do not honor the Form Feed character when printing text files - so not sure this will fix it for you. Do you have other processes running on the mainframe that successfully append multiple reports to a single file and subsequently print each report on separate pages? Because if not, it may just be that your more modern printer is ignoring the embedded FF character. &lt;BR /&gt;&lt;BR /&gt;So, the suggestion from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; to make all of the reports in a single SAS EXEC step might be the better answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Feb 2019 21:04:53 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2019-02-14T21:04:53Z</dc:date>
    <item>
      <title>SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535723#M147139</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on SAS in the mainframe environment. I have 3 input files with different data that I need to process. I am processing each input file in a separate step within the JCL and writing the SAS observations to the one output file using PROC PRINTTO in 3 steps respectively. I have created one output file with 3 different reports.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the reports are appearing one after the other in the file. I am looking for options to add a page break after each report so the next report starts on a new page instead of appearing in the same page as the previous report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please advise on what option I could use to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 19:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535723#M147139</guid>
      <dc:creator>sandhyababu</dc:creator>
      <dc:date>2019-02-14T19:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535748#M147147</link>
      <description>&lt;P&gt;You're actually creating the problem by using 3 steps instead of 1.&amp;nbsp; SAS can process many DATA and PROC steps within the same EXEC step, and will take care of the page numbering for you.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 20:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535748#M147147</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-14T20:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535750#M147148</link>
      <description>&lt;P&gt;You can try appending a form feed character (FF) using a DATA _NULL_ step after creating the output. I don't have ready access to a mainframe right now, but this SHOULD work.&lt;/P&gt;
&lt;P&gt;Try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myprint file="myuid.printer.flatfile" DISP=mod;
proc printto print=myprint new;
run;

title "Report 1";
proc print data=sashelp.class;
   where sex='F';
run;
proc printto;run;
/* Add the form feed: */
data _null_;
  file myprint mod;
  put _page_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Rather than use PROC PRINTTO, you might consider using ODS to write the output instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing file="myuid.printer.flatfile" DISP=mod;
title "Report 1";
proc print data=sashelp.class;
   where sex='F';
run;
ods listing close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I will say that Windows printers do not honor the Form Feed character when printing text files - so not sure this will fix it for you. Do you have other processes running on the mainframe that successfully append multiple reports to a single file and subsequently print each report on separate pages? Because if not, it may just be that your more modern printer is ignoring the embedded FF character. &lt;BR /&gt;&lt;BR /&gt;So, the suggestion from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; to make all of the reports in a single SAS EXEC step might be the better answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 21:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535750#M147148</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2019-02-14T21:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535907#M147206</link>
      <description>&lt;P&gt;Thank you for the suggestion!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I combined all of the steps into one step to execute SAS within the JCL. I now tried to add 3 input files to same SAS step, processed each input file in a separate data step. I added one PROC PRINTTO and 3 PROC PRINTS within to write the data to the output file. I am still not getting the 3 reports on separate pages. Below sample is how I am doing. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Step EXEC SAS&lt;/P&gt;&lt;P&gt;-input files-&lt;/P&gt;&lt;P&gt;Data file1;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;Data file 2;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;Data file3;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINTTO PRINT='file';&lt;/P&gt;&lt;P&gt;PROC PRINT data=file1;&lt;/P&gt;&lt;P&gt;-titles, vars-&lt;/P&gt;&lt;P&gt;PROC PRINT data=file2;&lt;/P&gt;&lt;P&gt;-titles,vars-&lt;/P&gt;&lt;P&gt;PROC PRINT data=file3;&lt;/P&gt;&lt;P&gt;-titles,vars-&lt;/P&gt;&lt;P&gt;PROC PRINTTO;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 16:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535907#M147206</guid>
      <dc:creator>sandhyababu</dc:creator>
      <dc:date>2019-02-15T16:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535925#M147214</link>
      <description>&lt;P&gt;Why use PROC PRINTTO at all?&amp;nbsp; Why not let SAS use the file it would normally use to hold procedure output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would guess that the JCL you have used to define the output file does not hold the proper DCB characteristics that would include page breaks.&amp;nbsp; You could check that by inspecting the JCL log.&amp;nbsp; But it's much simpler just to remove both of the PROC PRINTTOs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing to consider if you really need results in a file as well as a printed report with page breaks ... you could print the data twice.&amp;nbsp; In the program you now have, just repeat all 3 PROC PRINTs, after the final PROC PRINTTO.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 17:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/535925#M147214</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-15T17:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/537200#M147690</link>
      <description>&lt;P&gt;Thank you for the suggestion!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following by removing the PROC PRINTTO and just printing all 3 files one after the other in 3 PROC PRINTS. The SASLIST contains all 3 reports one after the other without a page break. Could you please let me know what is wrong with the below. Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Step EXEC SAS&lt;/P&gt;&lt;P&gt;-input files-&lt;/P&gt;&lt;P&gt;Data file1;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;Data file 2;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;Data file3;&lt;/P&gt;&lt;P&gt;-Process data-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT data=file1;&lt;/P&gt;&lt;P&gt;-titles, vars-&lt;/P&gt;&lt;P&gt;PROC PRINT data=file2;&lt;/P&gt;&lt;P&gt;-titles,vars-&lt;/P&gt;&lt;P&gt;PROC PRINT data=file3;&lt;/P&gt;&lt;P&gt;-titles,vars-&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 20:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/537200#M147690</guid>
      <dc:creator>sandhyababu</dc:creator>
      <dc:date>2019-02-20T20:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Mainframe: Create multiple reports in one output file with Page break after each report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/537202#M147691</link>
      <description>Thank you for the suggestions. I will try the ODS option and I am also trying suggestion from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;.</description>
      <pubDate>Wed, 20 Feb 2019 20:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Mainframe-Create-multiple-reports-in-one-output-file-with/m-p/537202#M147691</guid>
      <dc:creator>sandhyababu</dc:creator>
      <dc:date>2019-02-20T20:55:52Z</dc:date>
    </item>
  </channel>
</rss>

