BookmarkSubscribeRSS Feed
ubu_fester
Fluorite | Level 6

I'm on Linux, SAS 9.4, generating hundreds of PDF reports.  

 

Randomly (maybe 1% of the time) a page in a given PDF document prints Asian/Mandarin characters for some unknown reason.

䙯潤 楬 慴楯 猠睩瑨楮⁴慲来琠穯湥

[This should be a sentence that actually says: "Ratio is below the target zone"]

However, the very next page will come out just fine.  I've attached an example of a portion of a problem page.

 

I believe all the data in the datasets behind the PDF report contain all U.S.standard ASCII/WLATIN1 characters.  I do NOT need UTF8 or other newer encodings for this project.

 

Can I force SAS ODS to only provide output (or have encoding) set to 'latin1' or 'wlatin1'?  

   - Adding a system option in my program (e.g, options ENCODING= latin1; ) does nothing except give me a WARNING line

   - I've tried (libname mylib "\mypath" outencoding=asciiany; ) but can't see how this can help ODS.

 

Any thoughts?

5 REPLIES 5
ubu_fester
Fluorite | Level 6

Attached is an exampleCapture.JPG

ballardw
Super User

What does the code look like that generates that? Is the text coming from a data set? Literal text in the program code? Macro reference?

 

If coming from a data set you can check the encoding with

proc sql;
   select encoding 
  from dictionary.tables
  where libname='LIBRARY' and memname='DATASET'
  ;
quit;

Where library and dataset are the names of the library and dataset in question. Both of those need to be in uppercase as that is how the dictionary tables store library and dataset names. If you might have a catalog or other library member with the same name as the data set add: and memtype='DATA'

ubu_fester
Fluorite | Level 6

Thanks for the SQL statement.  Looks like all my datasets used for generating the report have encoding set correctly.

 

I am using 'proc odstext' with macro references for the subheader section.  Proc odslist for the middle 'Implications' and 'Suggestions' sections, although you only see chinese characters are in the implications section.  Here's a sample:

proc odstext data=d&opid._out2;
p "Blah Blah Blah Reports - 3 months ending %trim(&datetxt)" / style=Heading1 {textalign=c color=MOPB}; 
p "&optxt.: " || name / style= Heading5{textalign=c};
p "Restaurant: %bquote(&rest_descr)" / style= Heading5{textalign=c};
p "Restaurant Group: %bquote(&restgrp_label)" / style= Heading5{textalign=c};
p " ";

I was doing some further testing (trial and error) and removed the footnote line from the code. (The footnote was not part of my screenshot in my original message.).  REMOVING the footnote line may have solved the issue.  Although I would prefer a footnote, I can live without it.

I think the problem is with this line:

 

footnote justify=right "Page ^{thispage} of ^{lastpage}    %qsysfunc(putn(&dte_today, MMDDYYP8. ))";

A 2015 message to this forum also noted problems with adding page numbers to a footnote.  https://communities.sas.com/t5/SAS-Procedures/How-do-insert-page-number-footnotes-in-an-ODS-PDF-book...

 

I lost probably 4 days of programming trying to troubleshoot this crazy SAS!  (tempted to start a rant [HERE])

I clearly do expect that page numbering should work within footnotes.  Is this a known issue since 2015 and it's still not fixed?

 

Here's the full page of what my issue originally looked like:

whole page.JPG

 

ballardw
Super User

I don't know if it would actually help but I suggest try removing any macro functions from the footnote. Create a separate variable prior to using the footnote and reference that variable.

ubu_fester
Fluorite | Level 6

Thanks for you help.

 

The mystery for me is that the footnote is partially printed as "Page 4 of"   >> should be "Page 4 of 10   030219"

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 5 replies
  • 1151 views
  • 0 likes
  • 2 in conversation