BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7

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.

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

  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.

cynthia

ballardw
Super User

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.

AbhianvGoswami
Calcite | Level 5

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;

PROC GSLIDE;

GOPTIONS CBACK=black

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

RUN;QUIT;

ODS PDF CLOSE;

/*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";

BrunoMueller
SAS Super FREQ

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
 
usesashelp
 
mode=add
 
noupdate
;
  truetype "C:\Windows\Fonts";
run;

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>";
run;
quit;

Bruno

ErikT
Obsidian | Level 7

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";

run;quit;

%mend;

data numbers;

input name $ number;

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

datalines;

first 102

second 202

third 303

run;

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2254 views
  • 0 likes
  • 6 in conversation