BookmarkSubscribeRSS Feed
Géraldine1
Calcite | Level 5

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

2 REPLIES 2
ChrisHemedinger
Community Manager

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).

 

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
Géraldine1
Calcite | Level 5
it is a .png file, I have tried with several kind of images (.png .jpeg), in several locations and I have tried to rename the image, same error 'invalid data length',nothing works..

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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