BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
We are using the following command to print the output directly to a printer in Unix.

FILENAME outfile "/myfolder/myfile.txt";
FILENAME outfile pipe 'lp -d pr908104';


The link

http://support.sas.com/onlinedoc/913/getDoc/en/odsug.hlp/a002217095.htm#a002536270

also mentions about using unix command to print

filename your-fileref pipe 'lpr -P printer-name';
ods printer file=your-fileref;

The example and the code we use shows that we have to use the Unix

How can i avoid using Unix commands to send the output to print as we are not permitted to use Unix commands for security reasons.

Can I use ODS Printer

Please help me with the syntax.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
The URL that you cite, also says (note in bold):

(begin quote)
Note: To print directly to a printer in the UNIX , VMS, or z/OS operating environment,
you can use the FILENAME statement. Specific information about your
operating environment is required when using the FILENAME statement.

See the SAS documentation for your operating environment before using this statement.

Commands are also available in some operating environments that
associate a fileref with a file and that break that association.
(end quote)

The web site that you reference, also has this example:
[pre]
Use the FILENAME statement with the PIPE command to associate a fileref
with your lpr print command.

Syntax:
filename your-fileref pipe 'lpr -P printer-name';
ods printer file=your-fileref;

Example:
filename local pipe 'lpr -p chpljj21';
ods printer file=local;

[/pre]
I do not have a Unix system (with a printer) to test on. But if I did have a system to test on, I don't know of any other way, except to use the LPR command. The only other thing I'd possibly try to do is create a PostScript (.PS) file but then you'd just have a PS file that would need to be printed with Unix commands. Your best bet for help might be to find the SAS Companion for your particular "flavor" of Unix, as referenced, or to contact Tech Support.

cynthia

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 594 views
  • 0 likes
  • 2 in conversation