BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have using pipe to redirect sas output and generate ps files. however, the same codes got different result in Unix and Windows platform. below is an example:

********************************;
filename hts pipe 'enscript -c -q -p test.ps';
proc printto print=hts new;
run;
proc print data=sashelp.class;
run;
proc printto;
run;
********************************;
In Unix, it generate the correct ps file. but in Windows, the first page of the generated ps file is blank and the real output is shown on the second page. It seems related to pipe device because the same code got different result
between Unix and Windows. Under Windows, PC SAS first write a new page to pipe? Does anyone know how to correct it? Thanks!
6 REPLIES 6
LinusH
Tourmaline | Level 20
I'm not so sure that it is SAS that behaves differently on different platform. It could be the encript application as well that behaves differently between platforms. Have you tested it with other applications than SAS?

/Linus
Data never sleeps
deleted_user
Not applicable
The enscript works the same under both unix and windows. I also test other programs with SAS, for example, using

filename hts pipe 'cat > test.lst';

then redirect output to hts. With PC SAS it output a page break '0C'x at the beginning while with unix SAS it does not. So I guess it may be a problem related to SAS pipe device?
Cynthia_sas
SAS Super FREQ
Hi:
Indeed, if you read this Tech Support Note, you will see the '0C'x is the "old" Carriage Return character:
http://support.sas.com/kb/3/396.html

PROC PRINTTO is an older proc. If it still follows that old convention of a leading page break ... I don't know whether there's a way around that. That's a question for Tech Support.

However, there is ANOTHER way to create a PS file:
[pre]
ods ps file='testclass.ps';

proc print data=sashelp.class;
run;

ods ps close;
[/pre]

Alternately, you could specify:
[pre]
ods printer ps file='testclass2.ps';

proc print data=sashelp.class;
run;

ods printer ps close;
[/pre]

Unless you really want the look of old LISTING window output, you might like the look of this type of Postscript output better.

cynthia
deleted_user
Not applicable
Thanks Cynthia,

I knew the ods way to produce ps file. But, I have my old codes worked well under AIX, and I need using put statement with line pointer, column pointer to create an customized report. It also use enscript to filter / highlight some pattern text in the final report. I have tried using the new ods features with my SAS version 9.1.3, but I found it is hard to create the same kind of report.

I am not sure if it is problem of proc printto; I tried using the data step as follows;

filename hts pipe 'enscript -c -q -p test.ps';
data _null_;
file hts;
set sashelp.class;
put name sex age weight height;
run;

The output is correct and not leading blank page.

As for the proc printto, it did not output a leading page break under Unix platform. If the output is a destination other than a pipe device, for example, an disk file:

filename hts 'c:\test.lst';
proc printto print=hts new;
run;

it did not output a leading page break, either.

So the problem is when using proc printto with a pipe device in PC SAS, it produce a leading blank page. Strange.
Cynthia_sas
SAS Super FREQ
Hi:
You might consider opening a track with Tech Support about it. I don't understand enough about operating system differences to know what SAS is doing differently working with the PIPE command. If anyone can figure out the "internals" or see what's happening, it would be Tech Support.

cynthia
deleted_user
Not applicable
Thanks. I will fill a report to the SAS Tech Support after hoilday.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1095 views
  • 0 likes
  • 3 in conversation