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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1034 views
  • 0 likes
  • 2 in conversation