Encoding: 102 TEXT
X-Mailer: Microsoft Mail V3.0 (beta-2)
Newsgroups: bit.listserv.sas-l
Date:         Wed, 7 Oct 1992 10:47:00 EST
Reply-To:     SPJ1@CEHIEC1.EM.CDC.GOV
From:         SPJ1@CEHIEC1.EM.CDC.GOV
Subject:      Laserjet II and landscape
Comments: To: SAS-L%UGA.BITNET@UGA.CC.UGA.EDU

---------------------------------------------------------------------------
Content       Response
Summary       Landscape mode for Laserjet II
Rlse/Pltfm    SAS 6.04
---------------------------------------------------------------------------

Marc Shaeffer writes:

>I am using SAS 6.04 with DOS 5.0 and an HP LASERJET II printer.  My
>problem is that whenever I send output to the printer by file 'prn' in
>the output window, it prints an additional blank page for every page of
>actual output.
>My options statement includes ps=60;  Any ideas?

>Also, I frequently produce reports from proc tabulate which fit only
>in landscape mode.  So far, the only way I can send SAS output to the
>printer in landscape is to first send an empty LOTUS worksheet with
>the set-up string for landscape.  This gets a little tedious as I have
>to exit SAS, load Lotus, return to SAS, etc.
>
>Any ideas how to send the SAS output window to a Laserjet II in
>landscape?
>
>Thanks!


     Recently I posed a similar question to the list, so I'll share my
knowledge.  Regarding blank pages, my question involved just the leading
blank pages in the output.  There were a number of suggestions, none of which
were the type of solution I was looking for.  One I remember is writing the
output to a file and then using a word processor to delete the leading page
eject character.

     For Marc's problem I'd suggest to write the data to a file (eg. FILE
'TEMP.DOC') and then use a word-processor to see if the printer is putting
the extra page feed or if SAS is.  My guess is that given the margins and
such that the Laserjet may have already defined, it can't print 60 lines on a
page.  SAS sends it 60 lines of output (though the last so-many are blank)
and the Laserjet simply puts them on two pages.  The last one "looks" blank,
but it's actually printing the remaining lines from the previous page.  Just
a guess.

    In response to Landscape printing, I came up with the following code to
change the output characteristics of the Laserjet II (see table A-1 on page
A-2 of the LaserJet series II Printer User's Manual for other
characteristics).  When you run this, just to the same FILE 'prn' that you've
been doing.  You should see some strange looking characters in the output
screen before and after your output, but that's what you want.


title ' ' ;
options pagesize=54 linesize=127 missing=' ' nonumber nodate;
* title stmt, nonumber nodate options needed for changing printer mode ;

* Now Get the Printer in Landscape Condensed Mode Printing ;
data _null_ ;
  file print;
  esc=byte(027); amper=byte(038); lparen=byte(040) ;
  zero=byte(048) ; one=byte(049) ; two = byte(050) ; eight=byte(056) ;
  D=byte(068) ; E=byte(069) ; H=byte(072) ; O = byte(079) ;
  l=byte(108) ; s=byte(115) ;
  put @1 esc @2 E ; * reset printer ;
  PUT @1 esc @2 amper @3 l @4 one @5 O ; * landscape printing ;
  put @1 esc @2 amper @3 l @4 '2' @5 E ; * top of margin to 2 lines ;
  put @1 esc @2 lparen @3 s @4 '12' @6 H; * change pitch to 12 cpi;
  put @1 esc @2 amper @3 l @4 eight @5 D ; * change to 8 lpi ;
  run ;

*-------------------------------------;
* PUT WHATEVER SAS CODE YOU LIKE HERE ;
*-------------------------------------;

* Now reset the printer and send a Page Eject ;
options nodate ;
data _null_ ;
  esc=byte(027); amper=byte(038); zero=byte(048) ; one=byte(049) ;
  H=byte(072) ; l=byte(038) ; E=byte(069) ;
  file print ;
  put @1 esc @2 amper @3 l @4 zero @5 H ; * form feed if you need it ;
  put @1 esc @2 E ; * reset printer to default settings;
  run ;


    Note: I got differing results with the compression depending on whether
we had a font cartridge installed or not.  Without it, this code produced
16.6 cpi rather than the expected 12, but it was still in landscape.

    Hope people find this useful.

Steve James


---------------------------------------------------------------------------
Name         Steve James                          The new computer's a piece
Mail Address SPJ1@CEHIEC1.EM.CDC.GOV              of junk, I'd really wish
Real address Centers for Disease Control          they'd sell it.  It never
             1600 Clifton Road NE, Mailstop F36   does a thing I want, only
             Atlanta, GA  30333                   what I tell it.
             (404) 488-4656                                  Author Unknown
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU