<?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: Printing to a new Page using  _PAGE_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399599#M96803</link>
    <description>&lt;P&gt;As I said, I'm rusty on file print but i think you need to have&amp;nbsp;it as part of Put statemen&amp;nbsp;for the page number, and if your report is going to be multiple pages then you have to provide logic to assign it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the output really have to go to a text file? If you use ODS RTF then the page number could be handled with options and by default each table starts on a page.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2017 19:40:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-28T19:40:42Z</dc:date>
    <item>
      <title>Printing to a new Page using  _PAGE_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399541#M96781</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get my simple output to print to a second page a piece of the output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also want to put the page number on each page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my test code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options pagesize=24 linesize=64 nodate pageno=1;

data classlist;
	file "newclasslist.lst";
	retain sumwgts 0;

	set sashelp.class end=last;
	if _n_ = 1 then
	  put @20 "This is my first HEADER"//;

	sumwgts = sumwgts + weight;

	put @5 name @25 age  @30 weight; 
	if last then do;
		put _page_ @15 "Total Summary of Weights on new page";
		put @27 sumwgts;
	end;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But the output is always only written to one page and I never get a page number.&amp;nbsp; What is it that I am doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nancy&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 16:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399541#M96781</guid>
      <dc:creator>SASHunter</dc:creator>
      <dc:date>2017-09-28T16:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Printing to a new Page using  _PAGE_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399544#M96782</link>
      <description>&lt;P&gt;Text-files don't support the concept of "page", so you have to switch to pdf or rtf.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 16:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399544#M96782</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-09-28T16:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Printing to a new Page using  _PAGE_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399549#M96783</link>
      <description>&lt;P&gt;I believe that the pagesize, linesize and page number options are only for output sent to the listing destination, Output window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token statement"&gt;file&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"newclasslist.lst" print&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or to see the page effect in SAS you may want to turn on the ods listing and add: File print; to send the text to the output window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note from the documentation for _page_:&lt;/P&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryTip" rowspan="2"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;If the current output file is printed, &lt;FONT style="background-color: rgb(252, 222, 192);"&gt;_PAGE_&lt;/FONT&gt; produces an output line that contains the appropriate carriage-control character. &lt;FONT style="background-color: rgb(252, 222, 192);"&gt;_PAGE_&lt;/FONT&gt; has no effect on a file that is not printed.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;So if you don't print the file you are likely not to see the (hopefully inserted) carriage control commands that are supposed to print a new page. However with the advent of ODS and many other output options my plain text with put statements has gotten rusty.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 16:57:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399549#M96783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-28T16:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Printing to a new Page using  _PAGE_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399561#M96788</link>
      <description>&lt;P&gt;Thanks - I added&amp;nbsp;PRINT to the file statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;file&lt;/FONT&gt; &lt;FONT face="Courier New" color="#800080"&gt;"newclasslist.lst"&lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080"&gt; print&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;This worked.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;What about the page number?&amp;nbsp; Is there a way to get that on there?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;Thanks so much.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;Nancy&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 12:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399561#M96788</guid>
      <dc:creator>SASHunter</dc:creator>
      <dc:date>2017-09-29T12:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Printing to a new Page using  _PAGE_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399599#M96803</link>
      <description>&lt;P&gt;As I said, I'm rusty on file print but i think you need to have&amp;nbsp;it as part of Put statemen&amp;nbsp;for the page number, and if your report is going to be multiple pages then you have to provide logic to assign it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the output really have to go to a text file? If you use ODS RTF then the page number could be handled with options and by default each table starts on a page.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 19:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-to-a-new-Page-using-PAGE/m-p/399599#M96803</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-28T19:40:42Z</dc:date>
    </item>
  </channel>
</rss>

