I can successfully "send" ods output to my caslibs.
But I'm struggling to send it to a project folder in sas viya 3.5.
What works for caslibs:
ODS GRAPHICS ON / height=800 width=1400 reset=all border=off antialiasmax=2500 tipmax=2500
imagemap=on imagename="hist_kernel_&tab.";
ods html5 path="/caslibs/reportspr/" (url=none)
body="hist_&tab..html";
My adoptation to the folders in sas viya fails:
%let outpath =/Projects/SAS Viya training VWFS/;
ods _all_ close;
ODS GRAPHICS ON / height=800 width=1400 reset=all border=off antialiasmax=2500 tipmax=2500
imagemap=on ;
ods html5 path="&outpath." options(bitmap_mode="inline")
body="hist_&tab..html";
It gives the following the following error:
ERROR: Physical file does not exist, /Projects/SAS Viya training VWFS/hist_SP_FACT_PROVISIONES.html. ERROR: No body file. HTML5 output will not be created.
Hi @acordes , sorry for the late response. I can see the SGPLOT is writing to png. Does it need to be a standalone png file? Have you tried having the SGPLOT produce an embedded SVG? Just to test producing the HTML works with this approach. Looking at your error the issue is writing the png file rather than creating the HTML.
Could you try the below and see if it runs?
filename HTMLTST FILESRVC folderpath='/Users/myuser/My Folder/' filename='ods_test3.html';
ods graphics on / imagemap noborder outputfmt=svg; /* enable data tips */
ods html5 path="/Users/myuser/My Folder" (url=none)
body=HTMLTST options(svg_mode='inline');
proc sgplot data=sashelp.class;
histogram height;
run;
ods html5 close;
Hi @acordes
I find when saving to SAS Content its easiest to user the FILENAME statement. The below works in my environment on SAS Viya 3.5
filename HTMLTST FILESRVC folderpath='/Users/myuser/My Folder/' filename='ods_test2.html';
ods html5 path="/Users/myuser/My Folder" (url=none)
body=HTMLTST;
proc sgplot data=sashelp.class;
histogram height;
run;
ods html5 close;
Hope this helps
Thanks,
Harry
Thanks @HarrySnart
It throws out the error:
1 %studio_hide_wrapper; 82 %studio_show_only_notes_wrapper; NOTE: ODS statements in the SAS Studio environment may disable some output features. 85 86 87 filename HTMLTST FILESRVC folderpath='/Projects/Portugal/' filename='ods_test2.html'; 88 89 ods html5 path="/Projects/Portugal" (url=none) 90 body=HTMLTST; NOTE: Writing HTML5 Body file: HTMLTST 91 92 proc sgplot data=sashelp.class; 93 histogram height; 94 run; NOTE: STATGRAPH 'SGPlot' has been saved to: WORK.___Graph___ NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.25 seconds cpu time 0.15 seconds NOTE: Listing image output written to /opt/sas/viya/config/var/tmp/compsrv/default/72bdcc64-062e-415c-a3b1-36de3f5a0e52/SAS_work9F8500006F01_bsul2237/SGPlot5.png. WARNING: GPATH or PATH is not a writable directory. It will be ignored. NOTE: There were 19 observations read from the data set SASHELP.CLASS. 95 96 proc sgplot data=sashelp.class; 97 histogram age; 98 run; NOTE: STATGRAPH 'SGPlot' has been saved to: WORK.___Graph___ NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.14 seconds cpu time 0.09 seconds NOTE: Listing image output written to /opt/sas/viya/config/var/tmp/compsrv/default/72bdcc64-062e-415c-a3b1-36de3f5a0e52/SAS_work9F8500006F01_bsul2237/SGPlot7.png. WARNING: GPATH or PATH is not a writable directory. It will be ignored. NOTE: There were 19 observations read from the data set SASHELP.CLASS. 99 100 ods html5 close; 101 102 %studio_hide_wrapper; 113 114
Hi @acordes , sorry for the late response. I can see the SGPLOT is writing to png. Does it need to be a standalone png file? Have you tried having the SGPLOT produce an embedded SVG? Just to test producing the HTML works with this approach. Looking at your error the issue is writing the png file rather than creating the HTML.
Could you try the below and see if it runs?
filename HTMLTST FILESRVC folderpath='/Users/myuser/My Folder/' filename='ods_test3.html';
ods graphics on / imagemap noborder outputfmt=svg; /* enable data tips */
ods html5 path="/Users/myuser/My Folder" (url=none)
body=HTMLTST options(svg_mode='inline');
proc sgplot data=sashelp.class;
histogram height;
run;
ods html5 close;
SAS Viya 3.5 Project folders do not exist in the filesystem/disk they are stored in the database Viya Server. Therefore one cannot write to them as you are trying to do.
Have a look at this thread
https://communities.sas.com/t5/SAS-Viya/create-project-folder-in-sas-viya-to-store-sas-code/td-p/737...
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.