BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aurimas
Calcite | Level 5

Hello SAS experts,

I am having a little problem with my pdf report. I am trying to get pdf report where should be a lot of national symbols, but instead of them I am getting bad characters.

Where are any way to get national symbols into pdf report?

P.S. I am using 9.1.3. version.

Thanks for any help,


Aurimas

1 ACCEPTED SOLUTION

Accepted Solutions
Aurimas
Calcite | Level 5

Problem solved. Maybe it will be useful to someone. So need to do these steps:

1. Download TrueType fonts or just use local TrueType fonts (<systemRoot>\fonts).

2. Copy needed TrueType font to <SASroot>\core\resource.

3. Now need to register new fonts. Run SAS procedure FONTREG. By default this procedure uses <SASroot>\core\resource directory, so need to run this script:

PROC FONTREG;

RUN;

4. Finnal step is just use new TrueType fonts. For example:

FONT_FACE = "<ttf> Arial"

Aurimas

View solution in original post

6 REPLIES 6
Cynthia_sas
SAS Super FREQ


HI:

  You don't show any code or any example of your data or the "national" symbols that you want. There have been other forum postings on using symbols such as the pound or the yen symbol. You could have a font issue in your output or you could have an encoding issue. If you are using double-byte symbols, then you may need to use a Unicode font. As an example of using plain ASCII characters in a PDF file, is in the screenshot. The code below created the output.

  Your best resource for help might be Tech Support.

cynthia


options nodate nonumber;
ods listing close;

***** Hex Codes *****;

data hex1;
  length Description $ 30;
  HexNumber='A2'; HexCode='A2'x; Description='Cent Sign'; output;
  HexNumber='A5'; HexCode='A5'x; Description='Yen Sign'; output;
  HexNumber='A9'; HexCode='A9'x; Description='Copyright Sign'; output;
  HexNumber='AE'; HexCode='AE'x; Description='Registered Trade Mark Sign'; output;
  HexNumber='B0'; HexCode='B0'x; Description='Degree Sign'; output;
  HexNumber='B1'; HexCode='B1'x; Description='Plus-or-Minus Sign'; output;
  HexNumber='B6'; HexCode='B6'x; Description='Paragraph Sign'; output;
  HexNumber='BD'; HexCode='BD'x; Description='Fraction One Half'; output;
  HexNumber='F7'; HexCode='F7'x; Description='Division Sign'; output;
run;

   

ods pdf file='C:\temp\ascii_hex.pdf';
proc print data=hex1 noobs;
run;
ods _all_ close;

ods listing;

Aurimas
Calcite | Level 5

I think you don't realy understand my problem. I am trying to get pdf report with national symbols (characters/letters) like š, č, ų, ė, į etc.

National letters are in my data, title and header, but instead of them I am getting wrong / understandable letters.

Here is small example of my code:

proc template;

     define style Styles.ba;

     parent = Styles.Normal;

     STYLE SystemTitle /

     FONT_FACE = "arial"

     FONT_SIZE = 3

     FONT_WEIGHT = bold

     FONT_STYLE = italic

     FOREGROUND = cx000000

     BACKGROUND = cxfefefc

     VJUST=C

     /*more code*/

     end;

run;


ods pdf file="C:\temp\test.pdf" style=ba notoc;

option locale=lt_LT;

title j=l f='Arial' h=16pt bold 'ĄČĘĖĮŠŲŪ';

data temp1(encoding="wbaltic");

     A='ČČČ'; B='ŠŠŠ';output;output;

     A='ŪŪŪ'; B='ĖĖĖ';output;

run;


data temp2;

     set temp1;

     obs=_n_;

run;


proc report nowd data=temp2;

     col obs  A B;

     define obs / display noprint;

     define A / display "Column1 ŠŠŠ" style(header)={cellwidth=250px};

     define B / display "Column1 ĖĖĖ" style(header)={cellwidth=300px};

quit;

ods pdf close;

So any ideas how to get national letters like š, č, ė, į, ų, ū, ą, ę in pdf report?

Andre
Obsidian | Level 7

Under a locale french  your program gives  see image

but also many warning in the log

61option locale=lt_LT;
------
35

WARNING 35-12: Le codage de la session en cours, wlatin1, ne prend en charge pas ce paramètre

local. Cependant, l'option système LOCALE a été modifiée de façon à refléter
les fonctionnalités culturelles.

saying that the encode of my sas session is wlatin1 which did not accept this kind of option

BUT the locale system option was changed to reflect cultural functionnalities

result under locale french but with your code

so for RIGA i tried

92option encoding=wbaltic;
--------
30

WARNING 30-12: L'option SAS ENCODING n'est valide qu'au démarrage du Système SAS. L'option SAS

est ignorée

saying that the encoding in baltic must be specified at startup

I think you have to  test this

proc options group=languagecontrol;run;

to clarify your context and report..

Note there is a sas book  about "SAS encoding understanding the details" of Manfred Kiefer

Andre

Andre
Obsidian | Level 7

I see only now that you are under sas 9.1.3

I was testing under 9.3.2

Sorry

Andre

Aurimas
Calcite | Level 5

Yes, this is the biggest problem. I really need that my pdf report with national letters would be working under 9.1.3.

Aurimas
Calcite | Level 5

Problem solved. Maybe it will be useful to someone. So need to do these steps:

1. Download TrueType fonts or just use local TrueType fonts (<systemRoot>\fonts).

2. Copy needed TrueType font to <SASroot>\core\resource.

3. Now need to register new fonts. Run SAS procedure FONTREG. By default this procedure uses <SASroot>\core\resource directory, so need to run this script:

PROC FONTREG;

RUN;

4. Finnal step is just use new TrueType fonts. For example:

FONT_FACE = "<ttf> Arial"

Aurimas

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
  • 6 replies
  • 1704 views
  • 0 likes
  • 3 in conversation