Help using Base SAS procedures

Extra lines are coming in Page Number when output is routed to a file using PRINTTO

Reply
New Contributor
Posts: 3

Extra lines are coming in Page Number when output is routed to a file using PRINTTO

Extra lines are coming in Page Number when output is routed to a file using PRINTTO.I am trying to write the report in SASLOG into a file. The report is having 3 different layouts and one variable is there for page number. First layout ends at page number 749. Second layout is having 7 pages. Third layout starts at page number 757(749 + 7) in SASLOG but in report page number for third layout is 771. Not sure from where these extra lines are coming in output file.please help om how to correct the page number in file.
Super Contributor
Posts: 252

Re: Extra lines are coming in Page Number when output is routed to a file using PRINTTO

Without seeing your code, it's hard to tell. It may just be that all the stuff that comes before in the log takes up seven pages.

 

You can reset the page number to anything you like - try this just before the first layout:

option pageno=1;
New Contributor
Posts: 3

Re: Extra lines are coming in Page Number when output is routed to a file using PRINTTO

I can understand that PRINTTO is playing some trick.The page number(749 + 7 = 756. So next line should be 757 which is coming in SASLOG) is correctly calculated When the report is getting written into SASLOG by using PROC PRINT but when I am trying to route the same report to an external flat file by using PRINTTO , then the page number(It should be 757 but its coming as 771) is not coming correctly.

Please suggest why these extra lines(771 - 756=15) are coming in external file and how to suppress these lines and write correct page number(757).
Super User
Super User
Posts: 7,050

Re: Extra lines are coming in Page Number when output is routed to a file using PRINTTO

Are you comparing the page numbers generated in the SAS LOG to the page numbers generated in the LST output? They are separate output locations with their own page counters.

New Contributor
Posts: 3

Re: Extra lines are coming in Page Number when output is routed to a file using PRINTTO

There is a varible PG_NO which is calculating the page number for first and second layout. The same varible is not there in third layout. Still third lyout is printing the page number.
First and second layout is having total 756 pages. So the third layout should start from page 757. It is starting in page 757 in SASLOG but when i am routing the same report to an external file using PROC PRINTTO the third layout is starting from page number 771. I am confused from where these extra lines are coming. Please help.
Super User
Posts: 11,343

Re: Extra lines are coming in Page Number when output is routed to a file using PRINTTO

Post code and the program log.

 

If you test with smaller data sets such that only 2 pages are created for the first two groups do you still have a similar behavior for a the third? If so post dummy data that will generate the type of output you describe with small enough data we can examine. (I really am not interested in trying to wade through 700+ pages).

 

 

Ask a Question
Discussion stats
  • 5 replies
  • 260 views
  • 0 likes
  • 4 in conversation