BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

I have a strange error while executing the ods object code.

The error is like I have no file for the logo, but the logo is appearing on output document.

My code is :

proc sql noprint;
	select count(distinct Code) into :nb_obs_nom_prd  from Accord;
quit;

%macro fichiers_publipostage_pdf_accord;
	%do i=1 %to &nb_obs_nom_prd.;


		data _NULL_;
			set ACCORD;
					CALL SYMPUTX(COMPRESS('Produit'),Produit);
	                CALL SYMPUTX(COMPRESS('Code'),Code);
                    CALL SYMPUTX(COMPRESS('Montant_min_de_vers_init'),Montant_min_de_vers_init);
	                CALL SYMPUTX(COMPRESS('FRAIS_GESTION_OL_UC2'),FRAIS_GESTION_OL_UC);

		run;



		OPTION NODATE NONUMBER;
		OPTIONS PAPERSIZE=A4;
		options orientation=portrait;
		OPTIONS TOPMARGIN=.001 in BOTTOMMARGIN=.001 in LEFTMARGIN=.001 in RIGHTMARGIN=.001 in ;
		ODS NORESULTS;
		ODS PDF FILE = "&Publipostage.\&Code..pdf" dpi=1800;
		ODS ESCAPECHAR = "^";

		data _NULL_;
			declare odsout obj();
	obj.layout_absolute(width:
			"8.26 in",height:"11.68 in" );

	obj.region(width:
			"18cm" ,x: "1.5cm", y:"1cm", height:"0.4cm", style_attr: "bordercolor=cx338AF");
			obj.line( style_attr: "bordercolor=cx338AFF", size:'0.8mm');

  obj.region(width:
			" 5 cm",x:"1.5cm", height:"2.2 cm",y:"1.5 cm", style_attr: "bordercolor=cx338AFF bordercolor=cx338AFF");
			obj.image(file : "\\XXX\logo_officiel.png" , overrides : " width=100pct ");

  
			run;

	%end;
%mend;

%fichiers_publipostage_pdf_accord;

This is the error :ERROR: Path "file:///\XXXXX\logo_officiel.png" does not
exist. 

 

But I have the logo on document.

 

Thank you for your help!

 

 

 

1 REPLY 1
ballardw
Super User

You want to make sure than any path referencing an external file starts at a drive / mount point and is accessible from where ever SAS executes. If your SAS is running in any of the server variants then it very likely does not see files from your local computer.

 

Also note error message text where I have underlined

:ERROR: Path "file:///\XXXXX\logo_officiel.png" does not 

compared with the code posted which may mean the code run isn't quite what you showed, also an extra x in the code.

file : "\\XXX\logo_officiel.png" 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 155 views
  • 0 likes
  • 2 in conversation