BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SaschaD
Obsidian | Level 7

Hello,

 

My code below runs successfully, but only shows the text of the two variables count_NO_contract and count_NO_sales.

How do I have to change the code?

 

 

 

filename REPORT "%sysfunc(pathname(work))\output.html"; 
filename SEND 
	email to		= "XXX@XXX.com"
	SUBJECT 		= "Test Subject"
        content_type 	        = "text/html"
	ATTACH 			= "&PATHNAME";

ods html file	= REPORT
         style	= HTMLBlue;

PROC REPORT DATA=APPG.AZL_NG_BESTAND;
	COLUMN workday workvalue;
	DEFINE workday / GROUP;
	DEFINE workvalue / F = COMMAX10.;
	RBREAK AFTER / SUMMARIZE;
	WHERE workday >= 20220201;
RUN;

ods html close;

data _null_;
  infile REPORT;
  file SEND;
  input;
  if _infile_ ne '</html>' then put _infile_;
  else do;
	PUT 'Process finished';
	PUT 'unknown contracts: &count_NO_contract';
	PUT 'unknown sales: &count_NO_sales';
  end;
run;

 

Thanks

Sascha

 

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

Use double quotes instead of single quotes when you want to expand macro variables.

	PUT "unknown contracts: &count_NO_contract";
	PUT "unknown sales: &count_NO_sales";

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12

Use double quotes instead of single quotes when you want to expand macro variables.

	PUT "unknown contracts: &count_NO_contract";
	PUT "unknown sales: &count_NO_sales";
Kurt_Bremser
Super User

The solution has already been given, but do you really store your dates like this:

WHERE workday >= 20220201;

?

If yes, it's a VERY BAD IDEA, as it deprives you of the use of all the nice tools SAS provides for dealing with dates, makes date calculations very hard, and on top you have to use at least 5 numeric bytes to store them. SAS date values need only 4.

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
  • 299 views
  • 1 like
  • 3 in conversation