BookmarkSubscribeRSS Feed
tarthur
Calcite | Level 5

I’ve got some sas code that generates html which contains an sgplot with drillable data points.  When clicking on a line marker, it runs code in sas job execution.  This all works fine in studio.  Now I’m trying to run it in sas job execution and I can’t get the output to appear.  There are no errors in the log.  I think I’m just not specifying the correct job definition parameters.  Can you advise?  Also, would I leave off the ods html and ods graph statements in my code?

 

Here are the ods statements which I currently have commented out:

/* ods html device=png style=htmlblue newfile=page; */

/* ods graphics / reset imagemap=yes height=4in width=7in outputfmt=png; */

 

Here are the job definition parameters:

_action=wait

_ODSSTYLE=HTMLBlue

_OUTPUT_TYPE=html

_ODSDEST=html

_ODS_DEVICE=png

 

I get the html page with a missing icon for the sgplot output.

 

%jesbegin is generating these ods statements:

ods graphics on / outputfmt=png;
ods html style=HTMLBlue file=_webout;
4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Try option

ods html style=HTMLBlue file=_webout gpath=;
GPatel
Pyrite | Level 9

All:

I have SAS Code below, and upon SAS Job Execution, it doesn't render sgplot image. 

 

ods graphics on / outputfmt=png;
ODS HTML style=HTMLBlue file=_webout gpath= _ODSOPTIONS = options(BITMAP_MODE='inline');
 proc sgplot data=xxx  ;

title; footnote;

by year;

  xaxis type=linear min=&min_y. max=&max_y. values=(&min_y. to &max_y. by 1);

series x=time y=estrips / name="mrfss" lineattrs=(thickness=1.85 color=black) markers markerattrs=(size=3.5px color=black) break;
series x=time y=lower_eff / name="mrfss_ci" lineattrs=(thickness=1.7 pattern=ShortDash color=ligr) break legendlabel="95% Confidence Interval" markers markerattrs=(symbol=x size=4px color=gray);
series x=time y=upper_eff / lineattrs=(thickness=1.7 pattern=ShortDash color=ligr) break legendlabel=" " markers markerattrs=(symbol=x size=4px color=gray);

 

yaxis offsetmin=0 ;

run;

ods html close;
ods graphics off;

 

I am getting 

GPatel_0-1734888390324.png

 

FredrikHansson
Obsidian | Level 7

I'm sorry if I missled you.

"_ODSOPTIONS" is a parameter that must be submitted to the JobExecution job. The parameter will be handled by the %JESBEGIN-macro.

%JESBEGIN macro will generate a ods-statement for you. To avoid confusion I would remove the ods-statement from your code.

 

The code below works for me.
I call the job with the parameter _ADDJESBEGINENDMACROS set to "false" to prevent %JESBEGIN from executing before my own code. Then I call %JESBEGIN from within my code to leverage the functionality within the macro.

 

Tip: Parameters can be set in job properties.

Tip2: Set the _DEBUG-parameter to true to see what code is generated from %JESBEGIN.

 

* Job must be called with parameter _ADDJESBEGINENDMACROS set to "false"	;


%let _ODS_DEVICE = png;
%let _ODSOPTIONS = options(BITMAP_MODE='inline');


options mprint;
%JESBEGIN;
options nomprint;

title; footnote;
proc sgplot data=sashelp.class;
 scatter x=height y=weight;
run;

%JESEND;
FredrikHansson
Obsidian | Level 7

Try setting:

_ODSOPTIONS = options(BITMAP_MODE='inline')


This option will convert your binary picture into a BASE64-encoded string that is included into the HTML. The pictures are not stored as separate binary files.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1479 views
  • 3 likes
  • 4 in conversation