Dear Community,
I am trying to create a powerpoint through an ods powerpoint on sas entreprise guide.
I have tried with these to ways :
/* option 1*/
proc template;
define style styles.imagebackground;
parent=styles.powerpointlight;
class body /
backgroundimage="&CHEMINDATA.Slide1.png";
class data, table, headersandfooters /
bordercolor = dark2;
class systemtitle, systemfooter /
just=center;
class bodydate /
just=right vjust=top width=50%;
class pageno /
just=left vjust=top width=50%;
end;
run;
ods powerpoint file='"&cheminout.&nom_rapport..ppt' style=styles.imagebackground;
proc odstext;
p "";
p "test";
run;
ods powerpoint close;
/* option 2/
ods powerpoint file='"&cheminout.&nom_rapport..ppt' options(backgroundimage="&CHEMINDATA.Slide1.png");
proc odstext;
p "";
p "test";
run;
ods powerpoint close;
For these 2 options an error appears 'Invalid data error' an no image is displayed on the background:
/*log 1*/
23 proc template;
24 define style styles.imagebackground;
25 parent=styles.powerpointlight;
26 class body /
27 backgroundimage="&CHEMINDATA.Slide1.png";
SYMBOLGEN: Macro variable CHEMINDATA resolves to /home/E0399071/wise/DEVOPS/ACXIM_PRP/RM/MLE_RT_063141/REPORT/DATA/
28 class data, table, headersandfooters /
29 bordercolor = dark2;
30 class systemtitle, systemfooter /
31 just=center;
32 class bodydate /
33 just=right vjust=top width=50%;
34 class pageno /
35 just=left vjust=top width=50%;
36 end;
NOTE: Overwriting existing template/link: Styles.Imagebackground
NOTE: STYLE 'Styles.Imagebackground' has been saved to: WORK.TEMPLAT
37 run;
38
39
40 ods powerpoint file='"&cheminout.&nom_rapport..ppt' style=styles.imagebackground;
The SAS System
ERROR: Invalid data length.
41
42 proc odstext;
43 p "";
44 p "test";
45 run;
NOTE: The PROCEDURE ODSTEXT printed page 1.
46 ods powerpoint close;
NOTE: Writing POWERPOINT file: ./"&cheminout.&nom_rapport..ppt
/*log 2*/
23 ods powerpoint file='"&cheminout.&nom_rapport..ppt' options(backgroundimage="&CHEMINDATA.Slide1.png");
SYMBOLGEN: Macro variable CHEMINDATA resolves to /home/E0399071/wise/DEVOPS/ACXIM_PRP/RM/MLE_RT_063141/REPORT/DATA/
24
25 proc odstext;
26 p "";
27 p "test";
28 run;
ERROR: Invalid data length.
NOTE: The PROCEDURE ODSTEXT printed page 1.
29 ods powerpoint close;
NOTE: Writing POWERPOINT file: ./"&cheminout.&nom_rapport..ppt
30
=======> Do you have any clue in how I can solve this problem?
Thank you in advance
Best regards
I don't think you need the PROC TEMPLATE to get a background image. @JaneEslinger shares a simple approach in this blog post.
Make sure (of course) that the image you reference is accessible in your SAS session, that it's a valid image file, and that the name is correct (case matters too, on UNIX systems).
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.