DATA Step, Macro, Functions and more

simulate a line printer in PC SAS

Reply
N/A
Posts: 0

simulate a line printer in PC SAS

I need to simulate an old mainframe application on the PC. I need to place characters into grid locations on an 8.5 x 11 sheet of paper. The application runs 66 lines per page and either 6 chars per inch or 12 chars per inch. Any suggestions as to handle this?

There will be 1 obs per 2 pages.
Respected Advisor
Posts: 3,899

Re: simulate a line printer in PC SAS

Hi zouclay
To have it precise I assume you would have to use SAS/Graph with the Annotate facility and Proc Ganno. With the Annotate facility you can define the coordinate system you need and place you letters as precise as you want. The output is a picture.
But: Unless you're familiar with SAS/Graph and Annotate it will cost you quite a bit of work to reach your goal.

Another way could be to forget about being that precise and recreating the past: You could just print your output using a font like courier with an appropriate size. This would only look close to how it had been - but much easier to implement.
You can always use a datastep with put statements to have your output in the columns and lines you want to.

If your challenge is about printing labels and the like then have a look a Proc Forms: http://support.sas.com/documentation/onlinedoc/base/91/forms.pdf

HTH
Patrick
N/A
Posts: 0

Re: simulate a line printer in PC SAS

I have tried proc forms. I used to be an old hand at proc forms in mainframe times. I am trying to "pre-slug" optical mark forms. I used to do this all the time in the age of the mainframe and line printer. I basically need to print an "*" in a bubble. This used to involve just laying out the line and dumping the * in the correct position.

The problem I am having is in the interaction between SAS, the printer driver and the font selected.

I am looking for something that is fairly easy to do in graphic programs like Adobe Illustrator. I want to set the line spacing and the character spacing. I am mystified at how to do this in SAS these days.
zoej
SAS Super FREQ
Posts: 8,743

Re: simulate a line printer in PC SAS

Hi:
A long time ago, in a galaxy far, far away, on a mainframe line printer, you could get (most often):
Landscape mode:
132 characters for your linesize (12 char per inch X 11 inches) and
51 lines down the page for your pagesize (6 lines per inch x 8.5 inches)

Portrait mode:
102 characters for linesize (12 char per inch x 8.5 inches) and
66 lines down the page for pagesize( 6 lines per inch x 11 inches)

The output was almost always landscape and the font that we used was SAS Monospace or more a generic "line printer" font. When we
finally got away from perforated paper, then we started to be able to get "portrait" output -- but it was all in upper case until we got a printer with
an upper and lower case print train.

As I remember it on the mainframe, your DD statement for SYSPRINT always went to SYSOUT=A or something and SYSOUT=A
automatically went to a "line printer".

The other big difference was that the mainframe used "carriage control characters" -- so even if your linesize was 132, the DCB of the
SYSPRINT file was LRECL=133 and VBA or FBA -- where the A meant that carriage control characters were in position 1 of the file. I'm not
even sure that you can make PC printers read those kind of carriage control characters these days.

You -can- still create an ASCII text file that will approximate the mainframe "look and feel" by sticking with the LISTING window and using a
program similar to that shown below.

Next, the issue comes in on how you direct this file to the printer. Do you use Notepad? Well, Notepad has a default font and default
interface for working with the printer. Do you use Word? Word has the NORMAL.DOT template in play when you print from Word.

On the PC, if you open your SAS LISTING output in Notepad or Word, you will see that those applications generally use a proportional space
font by default and so, the output viewed in Word or Notepad, will not LOOK like the mainframe printer output outside of the SAS Listing Window.
The output will only start to look like mainframe output again after you change your font in the viewing software (Word or Notepad) to
SAS Monospace 8 or 9 pt on the PC.

The program below shows you what DATA _NULL_ to LISTING output would look like. Review the SAS output in the LISTING window and then
open the file in Word or Notepad and see the difference. The PROC PRINTTO "sandwich" is the way that I would capture the
equivalent of what goes to the SAS listing window into an ASCII text file. Whether the "page breaks" are respected when you print the file,
depends on the interface between the printer and the software that does the printing.

You may actually have to experiment with PROC FORMS in page mode on a PC printer: http://support.sas.com/documentation/onlinedoc/base/91/forms.pdf

If you can't get what you want with DATA _NULL_ and this documentation doesn't help you with PROC FORMS, then your next stop
should be SAS Tech Support. They may be able to help you work with the specific print driver and rendering software and form to come up with the best solution.

cynthia
[pre]
proc printto file='c:\temp\lnprt.txt' new; run;
title; footnote;
options orientation=landscape linesize=132 ps=51 ;

data _null_;
file print notitle;
put @1 '0..................................................................................................1.........1.........1.........1..';
put @1 '0........1.........2.........3.........4.........5.........6.........7.........8.........9.........0.........1.........2.........3..';
put @1 '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012';
do i = 4 to 51;
put @1 '.....line: ' i 2.0;
end;
run;

proc print data=sashelp.class;
title 'Line 1 Title Proc Print';
run;

proc means data=sashelp.class;
title 'Age Info';
var height;
class age;
run;

proc printto; run;

[/pre]
Ask a Question
Discussion stats
  • 3 replies
  • 177 views
  • 0 likes
  • 3 in conversation