BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

Hi Guys,

Suppose I have below location sales reports so I want sent  sales report  by respective location using proc report  procedure 

Area_Location:

 

 

 

11 REPLIES 11
andreas_lds
Jade | Level 19

What do you mean by "sent"?

Cynthia_sas
SAS Super FREQ
Hi:
I'm not sure what you've posted. This seems to be a CSV data file? You call this a location sales report? Is there some column in the data the identifies whether something was "sent"?? You have not provided any logic or examples of code you've tried to generate the "sent" report. Typically, before you could use PROC REPORT with this data, you'd have to import the CSV file into SAS. There are 2 ways to do this: PROC IMPORT or a DATA step program. Have you written the code yet to import this data file into SAS format?
Once you do that, you'll then need to understand how the "sent" report is derived from the "location" report. We don't know that logic from just looking at the data and without more direction about the logic or seeing your import code. There's a lot you can do with PROC REPORT, but without some examples of what you mean, it is hard to do more than ask for more information.
Cynthia
BrahmanandaRao
Lapis Lazuli | Level 10
My question is how to sent mails report respective location wise using proc report procedure
andreas_lds
Jade | Level 19

@BrahmanandaRao wrote:
My question is how to sent mails report respective location wise using proc report procedure

So, do you have code sending one mail? If not start with that task, the documentation of the filename-statement tells you all you need to know to send a mail. For the larger task, you need a variable in the data identifying the location.

BrahmanandaRao
Lapis Lazuli | Level 10
data sales; 
length zip $ 5 cty $ 8 var $ 10;
input zip $ cty $ var $ sales; 
label zip="Zip Code"
cty="County" 
var="Variety" 
 sales="Monthly Sales"; 
 datalines; 

52423 Scott Merlot 186. 
 52423 Scott Chardonnay 156.61 
52423 Scott Zinfandel 35.5 
 52423 Scott Merlot 55.3 
 52388 Scott Merlot 122.89 
 52388 Scott Chardonnay 78.22 
 52388 Scott Zinfandel 15.4 
52200 Adams Merlot 385.51 
 52200 Adams Chardonnay 246 
 52200 Adams Zinfandel 151.1 
 52200 Adams Chardonnay 76.24
 52199 Adams Merlot 233.03
 52199 Adams Chardonnay 185.22
 52199 Adams Zinfandel 95.84
 ;
run;


proc report data=sales headline headskip;
	title 'Grouped Report';
	column cty zip var sales;
	define cty	/group width =6 'Country/Name';
	define zip /group ;
	define var/group order=freq descending ;
	define sales/analysis sum format=6.2 width=10  ;
	run;

Please give solution for this report  procedure how to send email respective cites 
BrahmanandaRao
Lapis Lazuli | Level 10
Please give syñtax using this report
How to send to adam and scott
Cynthia_sas
SAS Super FREQ
Hi:
To help you out, example 2 starting on page 7 in this paper https://support.sas.com/resources/papers/proceedings11/300-2011.pdf shows how to send a report as an attachment to an email. The paper shows using PROC PRINT with ODS RTF to create a file that is attached to an email. However, any SAS procedure that produces results could be inserted where the paper shows PROC PRINT -- so PROC REPORT or PROC FREQ or PROC GLM would work because they produce results. PROC SORT would not work because SORT does not produce report results.
In the paper, the email addresses are hard-coded. To send mail "automatically", you need to have a dataset of the names/emails to use. And you would likely need more advanced DATA step and SAS Macro techniques in order to send individual mails to individual people.
Note that your SAS Administrator may need to set system options related to email in order for this to work with your system's email application.
Cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 11 replies
  • 944 views
  • 0 likes
  • 4 in conversation