Archive for the ‘AAG’ tag
SAS: Where Also
Ever heard of ‘where also’? Neither did we.
We have to give credit to the guys at the SAS Community.
‘Where also’ allows you to add a series of where statements. The use acts like a single where statement with the and condition.
Example:
Data new_data;
set old_data;
where number=6;
where also number=.;
run;
“call symputX” is the symput upgrade
SymputX is the upgrade from Call Symput.
Syntax:
call symputx(“macro_var_name”, character_value (or numeric to be converted to char), symbol table def);
Where symput will produce a note about converting character values to numeric, symputx won’t produce such a note. Additionally it will strip leading and trailing spaces form the character value. Lastly, you can define which symbol table should be used (G=global, L=local, F=operates like symput).
data test;
set test_old;
call symput(‘variable_name’, ‘numeric value’) /* gets a warning although it runs successfully*/;
call symputx(‘xvariable_name’, ‘numeric value’) /* no warning for numeric conversion*/;
run;
Sending an email from SAS
Have you ever wanted to know when your code completes? Or maybe you want to automate the report to include sending an email?
Regardless, SAS is happy to send that email for you. The easiest way to do this is through the SMTP access method via filename statements.
Example:
filename sendemail email ‘toaddress@email.com’ subject=’This is a test email.’ from=’fromaddress@email.com’;
data _null_;
file sendemail;
put ‘Hi,’;
put ‘This is a email sent from SAS’;
run;
This is only a simple example. Here is another with an attachment.
filename sendemail email ‘toaddress@email.com’ subject=’This is a test email.’ from=’fromaddress@email.com’ attach=’/somesascode.sas’;
data _null_;
file sendemail;
put ‘Hi,’;
put ‘This is a email sent from SAS’;
run;
Email attributes can also be set in the data step through the EM_ directives.
filename sendemail email ‘toaddress@email.com’ ;
data _null_;
set somedataset;
put ‘!EM_TO! ‘ email_addr;
put ‘!EM_SUBJECT! ‘ subscription_name;
put name ‘ ,’;
put ‘This message was generated by a SAS data set’;
put ‘!EM_SEND!’;
run;
Pivot tables and Cheezy Graphs? No more…
As any good analyst knows, working with data is not the problem. Good analysts have the skill necessary to combine, split, merge, slice, aggregate, or summarize data any way you can imagine. However, is that enough?
Probably not..
What good does data do if you can’t communicate its meaning in a logical way. The day of sending a spreadsheet with pivot tables are heading out the door. Today users are wanting more. They are expecting more. And why is that?
Here are a few reasons users expect more from their data experiences:
- Google Analytics
- IPhone
- ITunes
- Amazon
These are just some of the companies leading the way in user interface. The days of cheezy HTML or excel graphs won’t cut it. Users quickly see they have to work to understand the information and move on.
The solution?
A complete toolbox of data tools and a team of professionals with tool experience. Today’s environment requires (along with some of our favorite vendors/partners):
- a storage solution
- an analysis tool
- a display layer
- Data Applied
- Custom solutions (Juice Analytics)
If your organization isn’t firing on all analytic cylinders, let us know. We have the tools, relationships, and people to move you to the next level. We have a proven track record of moving the needle through the integration of data into decision making.
Loyalty Marketing Analytics
What programs do you belong to?
If we asked you to list all of the loyalty programs you belong to, you could probably rattle off half a dozen or so. Then you might stop and list off 10 more that you joined but don’t use. In reality, the exercise would be less time consuming if I asked you to list retail outlets that don’t have a rewards program.
Why does everyone want you to join their loyalty program?
Data.
How do you use the data to improve sales?
As an organization that thrives on measurement and strategy, incentive programs are a gold mine. Droves of transactional data that can be worked to produce insightful nuggets of information regarding a specific group of customers that can then be leveraged to conduct relevant marketing.
Specifically, we help with questions like:
- What kinds of offers are most effective with this group
of customers? - What customers are the most valuable?
- What types of creative / messaging receives the highest response rate?
- Given my budget, which marketing efforts or mix thereof provide the best return?
- What cross-sell products are most successful with this customer segment?
- What communication schedule (frequency) is appropriate?
- etc etc..
At what point does it makes sense to engage analytics in loyalty programs?
The earlier you consult with analytics during your program / campaign design, the more successful you will be. We help clients with their customer segmentation, targeting, customer experience, and response/investment measurement and reporting.
Ultimately, we are here to improve your marketing. If you are thinking of beginning a loyalty program or would like to improve the return on the one you have, please contact us for a custom assessment.
SAS – Lowercase (lowcase) / Uppercase (upcase) / Proper Case (propcase)
We can’t stress the importance handling character case correctly. Here are the two functions you need to know and use correctly.
In order to convert all characters in a sting to lowercase, use the LOWCASE function. Example:
data ds_2;
set ds_1;
*convert it to lowercase;
new_char_var=lowcase(OLD_CHAR_VAR);
run;
In order to convert all characters in a sting to uppercase, use the UPCASE function. Example:
data ds_2;
set ds_1;
*convert it to uppercase;
NEW_CHAR_VAR=upcase(old_char_var);
run;
We can’t stress the importance of keeping this functionality in mind. Many a SAS script has gone awry because a developer didn’t take character case into account when using conditional or search statements.
TIP: A solid programming practice is to convert everything to lowercase before storing it. There are exceptions to this (like names, etc), but they can be handled on a case basis.
Also note the PROPCASE function. It capitalizes the first letter of each word in a string. Example:
data ds_2;
set ds_1;
New_Prop_Var=propcase(old_char_var);
put New_Prop_Var;
run;
This Is The New Prop Var.
Data Applied – The new breed of business intelligence
In recent weeks, we have began to work with a new company, Data-Applied Inc. You may have heard about the release of their new software for business intelligence and data mining. The application is a new breed of analytic tool.
For years, AFHood Analytics Group has been building custom Flash / Flex solutions to meet organizations needs. However, Data-Applied is a new leader creating software that allows users to intuitively visualize, extract, analyze, and mine data.Their new silverlight based suite not only looks impressive, but has the power to tackle difficult data scenarios.
If you have questions regarding the use of Data-Applied software or how it might fit into your organization, contact AFHood Analytics Group or Data-Applied directly.
You call that targeted?
As an agency, we see many different approaches to marketing. Oddly enough, the most popular method is the traditional ‘spray and pray’ marketing often labeled ‘targeted marketing’.
I would argue that sending a communication to a list of customers with not forethought to their preferences, value, demographics, location, etc is not targeted. Coincidentally, the amount of this type of marketing seems to increase as the economy turns south.
So it follows that there are two choices regarding targeted marketing methodologies:
- Accepting a low response rate and therefore working to increase your mailing list to get the desired increase in sales
- Working to increase your response rate (as well as many other metrics like: customer satisfaction, brand affinity, relevancy of communication, etc) by crafting the right message at the right time to the right customer
As you can likely infer, we lean more to the latter. If you have not picked up on our use of sarcasm while stating the obvious, we appologize.
We do realize that organizations default to the former method unconsciously as times get tough. However, we have the expertise and understanding to help you get back on track.
So herein exists a challenge, if we can’t improve your marketing return through the employment of data driven targeting, you don’t pay. Bold? We hope you think so, but we’re confident.
Let us show you how to improve the best of campaigns.
Segmentation? Can you be more specific?
We don’t normally share posts from other blogs, however this article resonated well with us.
http://b2bmarketingconfidential.blogspot.com/2009/10/segmenting-segmentation.html
Andy Hasselwander wrote a post regarding the word segmentation. It has to be one of the most over used buzz words in business today. We consider this one of those words users throw around when they are overwhelmed with customer data.
Andy does a good job outlining the process businesses should go through to define the type of segmentation they need. Additionally, he states the problems with trying to segment customers by every element (value, product, creative, promotion, channel, targeting) is impossible in one uber-model. However, who says you can only have one segmentation model?
Often we find that sophisticated customers need more than one model. The process for defining the model is the same. Yet different groups require a unique view of the customer base.
Kudos to Andy for a well written post and thoughtful view on segmentation.
SAS INTNX function ( add days, months, years, etc )
The INTNX function increments dates, times, or datetimes by specific or custom intervals.
Here is the basic syntax for INTNX:
INTNX(interval[multiple.shift-index], start, increment[, alignment])
The interval can be a set value like – DAY, WEEK, DTWEEK, YEAR, etc. You can also specify a custom interval. We will post more on that later.
The multiple is optional and used as such. If you want the interval to be a 2 year period or biennial, you could use YEAR2. It is the same with weeks. If you were calculating 2 week pay periods and you wanted to increment by such, you would declare the interval to be WEEK2.
The shift-index lets you define a starting point within the interval. An example would be to start the week on Monday. The interval designation should be WEEK1.2 .
The start is your date, time, or datetime at which you want to begin the increment.
Increment is a positive or negative integer representing the number of interval shifts that should be made from the start.
Alignment is an excellent tool. It allows you to designate at which point SAS should return within an interval. You can specify:
B – beginning
M – middle
E – end
S – same
The default for alignment is beginning.