BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
fre
Quartz | Level 8 fre
Quartz | Level 8

Hi,

i'm using some code - see below - to send myself an e-mail, where the body contains:

- first paragraph

- output from a table

- last paragraph

 

The first and last paragraph are left-aligned, which is good.

But the output from the table is center-aligned, which I want to change to also left-aligned.  

I can't make that work.

What I tried to do in my code below is put '<p align="left"> _infile_ </p>';  - but that didn't give me the wanted result.

Does anyone has a solution for this?

 

%macro email_output;

%if &totobs. > 0 %then %do;

	filename REPORT "%sysfunc(pathname(work))\test.html";
		filename SEND email to           = "x.y@z.z.z"
		                    subject      = "WEBSERV: error!"
		                    from         = "x.y@z.z.z"
		                    content_type = "text/html";


		ods html file=REPORT;
		proc print data=WORK.QUERY_CHECK_DOUBLES; run;
		ods html close;

		data _null_;
					
		  infile REPORT;
		  file SEND;
		  input;

			if _infile_ = '<html>' 
				then do;
					put '<p>First Paragraph </p>';
					
				end;
		  		

			if _infile_ ne '</html>' 
				then
					put _infile_ ; 
					/* put '<p align="left"> _infile_ </p>';*/
		  		else do;
		  			put '<p>Last Paragraph</p></html>';
		  		end;
		run;




%end;

%mend;
1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Have you tried

options nocenter;

?

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

Have you tried

options nocenter;

?

fre
Quartz | Level 8 fre
Quartz | Level 8

Thank you, that did the job.

Always nice when there exists simple solutions.

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