BookmarkSubscribeRSS Feed
Virpi
Calcite | Level 5
How can I get a logo into a pdf report with mainframe?

Ods pdf text='(*ESC*)S={"/path/logo.jpg"}';

doesn't put the logo into the document even tough the logo reference on the proc report heading does that.
9 REPLIES 9
ballardw
Super User
I think you need to define a single escape character for SAS to send the right bits to pdf. Something like:

ODS ESCAPECHAR = '^';

Ods pdf text= '^S={"/path/logo.jpg"}';
Cynthia_sas
SAS Super FREQ
Hi:
When creating an ODS PDF or RTF file, the location of any image must be the physical location of the image when the PDF or RTF file is -created- ... so you must be certain that /path/logo.jpg is indeed the correct MAINFRAME path location for the logo. (...since any graphic images are converted to internal PDF or RTF format when the file is created, if the file is created on the mainframe, then the image file location must be accessible to the mainframe.)

The (*ESC*) method of specifying the ESCAPECHAR is the "universal" method (as opposed to the one character method) -- so that's OK. The issue, I think, partly depends on the version of SAS that you're using (there were issues in creating PDF files with ODS in SAS 8 and early SAS 9 that no longer exist in SAS 9.2); whether you are indeed specifying the image location correctly -- what you are specifying looks like a UNIX file location, so I'm assuming that you might be trying to pull the image from an AIX drive or Unix web server?? If so, you have to be sure that the server is available to your SAS job --when it runs-- (not when you open the file).

You might end up needing to work with Tech Support on this, they could actually test the code on a mainframe configuration.

cynthia
Virpi
Calcite | Level 5
The strange part in this seems that I can get the logo into proc report title (with style(report)={preimage}-definition) or with data _null_-step and the logo path on column header or data section but not with ods pdf text-statement.

So the path to the logo should be OK as it can be seen when on columnheader, reportheader or in columndata.
Cynthia_sas
SAS Super FREQ
Hi:
Well, it seems like the main difference might be that you're not using ESCAPECHAR in the PROC REPORT style override, but you are using ESCAPECHAR in the TITLE statement???

That definitely seems like a puzzle for Tech Support.

cynthia
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Your code needs to be explicit with preimage= or postimage= as well as what Cynthia mentioned about specifying an accurate zFS/HFS location for your image (jpg) file. This code works for a z/OS (IBM mainframe) generated PDF document:


ods pdf file="/u/websrv/perf/test/test_ods.pdf";
%let txt = This is my Title.....See Me Roar;
ods pdf text="^S={preimage=""/u/websrv/images/corp_logo1.jpg""} &txt";
ods pdf close;


Scott Barry
SBBWorks, Inc.
Virpi
Calcite | Level 5
Most strangest thing in this logo is that I have a logo in another report, the code is run from JCL and it is located on unix directory. There I have code like:

ods escapechar= '?';
ods pdf text="?S={just=right preimage=
'/SYSTEM/var/Subdirectory/File/Logo.gif'}";

But when I run the same code on mainframe SAS (interactive session) there is no logo, only text. The same happends when the code is on MVS and the code is run trough JCL.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will need to ensure that the USS HFS/zFS filesystem is accessible from any/all z/OS MVS systems where you can run SAS. I support a client where SAS is only licensed on one machine for sub-capacity licensing reasons, and so when I am accessing the USS filesystem contents through the mainframe browser, the URL prefix is different -- dedicated zFS for the SAS-licensed LPAR.

Scott Barry
SBBWorks, Inc.
Virpi
Calcite | Level 5
The logo is to be seen on proc report heading, not with ods pdf text.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you reply to your post and COPY/PASTE your SAS-generated log with expanded code and all SAS diagnostic messages so that you can get the most effective feedback.

Scott Barry
SBBWorks, Inc.

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
  • 9 replies
  • 1521 views
  • 0 likes
  • 4 in conversation