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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 669 views
  • 1 like
  • 3 in conversation