The SAS Output Delivery System and reporting techniques

Rotated Print in ODS PDF

Super Contributor
Posts: 358

Rotated Print in ODS PDF

Hi All:

I have a tricky one here - I have opened a track with SAS, but so far they say, 'You can't get there from here'. 

I hope I can get one of you wizards to help me on this - or tell me conclusively that it can't be done and just give up.

I have a ODS PDF document that I am printing - it is a customer statement - and is created only with PUT statements

(just like the old days).  I use N=PS and LINESIZE / PAGESIZE options and all the rest.  Not a PROC to be seen. 

The statement itself prints just fine.  My problem is that I also need to print a bar code at 90 degrees along the right

margin of the page about 3 inches from the top of the page (this is used by the machines that stuff the statements into

envelopes).  I have the bar code font and I am able to print the bar code on the statement - the problem is that I can't

get the bar code rotated so it prints correctly.  The bar code is in 3of9 format

Any thoughts?  I am using SAS 9.3 on a Windoze platform so ODS LAYOUT is an option, but I have no experience

whether this is possible or not.  Or could II use a custom template?

Any help would be appreciated.

Thanks in advance.

Posts: 8,743

Re: Rotated Print in ODS PDF


  I do not know of any custom template that would help you. ODS LAYOUT with PDF seems to be the way to go. And that means that your "older" FILE PRINT with PUT statements will have to change. As for rotating the bar code -- you may have to rotate the image outside of SAS, unless you can cause ODS LAYOUT to rotate it (which again, is a Tech Support question.)

  If Tech Support said that you can't get there from here, I would tend to believe them.


Super User
Posts: 10,500

Re: Rotated Print in ODS PDF

If I had to get something in the mail this week I might be tempted to revert to another old method: sending it to the printer twice.

Print the PDF versions. Reload into printer and then use a mail merge in landscape to get the barcodes. But I realize that may not be practical for certain size jobs.

I might investigate finding a way to make a very skinny chart in the desired location that would result in only an Axis label being visible and have that label in the barcode font. The options on the AXIS statement may allow sufficient manipulation to produce a readable bar code. This does assume that the bar code is an available font.

Posts: 1

Re: Rotated Print in ODS PDF

You can use ODS LAYOUT along with the ODS PDF. Here is an example:

/*Assuming that you already have barcode saved in a folder*/

ods pdf startpage=never style=journal file="C:\FileName.PDF" notoc ;

ods region height=.5in  width =.5in x=.5in y=.15in;



iback="C:\barcode.jpg" imagestyle=fit;



/*You can print barcode with angle or text rotation option in GSLIDE as well. Something like below assuming that font barcode would work fine with GSLIDE*/

note move=(35,40) color=black font=simplex HEIGHT=4 j=right "BARCODE TEXT";

Posts: 683

Re: Rotated Print in ODS PDF

Please note

In order to use a font it has to be registered in the SAS Registry

One can use Proc FONTREG to this, see example below. The NOUPDATE option only shows what would happen, but the SAS Registry is not updated

proc fontreg
  truetype "C:\Windows\Fonts";

To use it as suggested, find an example below:

proc gslide;
note color=black font="Free 3 of 9" height=10 j=right angle=90 "<123>";
note color=black font="Arial" height=10 j=right angle=90 "<123>";
note color=black font="Free 3 of 9 Extended" height=10 j=right  "<123>";
note color=black font="Arial" height=10 j=right  "<123>";


Posts: 31

Re: Rotated Print in ODS PDF

I remember that there is a special situation with Title statements. If you use A=90 or A=-90 it will print the title on the side of the output, if the output is created in PROC GSLIDE. When using simple FILE PRINT and PUT statements that does not work.

So the question is, would it be feasible for you to create the output in PROC GSLIDE, using the necessary Note statements?

Here is an example of what I mean:

%macro makeoutput(name,number);

title a=-90  "Right side of output &number";

proc gslide;

note "This is for &name";

note "Carrying number &number";



data numbers;

input name $ number;

call execute('%makeoutput('||name||','||number||')');


first 102

second 202

third 303


As you see the characters on the side are rotated inward. With R=180 you can rotate them outward, but you have to keep in mind that the rotation is by character, not by string.

Ask a Question
Discussion stats
  • 5 replies
  • 6 in conversation