AFHood Group Blog The thoughtless yammerings of marketing junkies..

7Jul/120

Exporting without double quotes

One of our junior programmers shot this one over after fighting with Proc Export for some time to remove the quotes from a string.

His need: export a single column of data without headers or quotes.

How he did it, quick and easy.

 

data _null_;
set inputdateset;
file "outputfilename";
put outputcolumnname;
run;

 

Sometimes the simple solutions are right in front of us.

21Apr/110

SAS Altlog option

If you run a production SAS environment or even a development environment for that matter, it is nice to have a specific location for all logs to be written and managed. ALTLOG helps achieve this.

The ALTLOG option can be set numerous ways, but we typically utilize 2.

1. As an option on the command line. Example:

sas sasprogram -altlog /my/log/dir/sasprogram_$timstamp\.log

2. Globally in the sas configuration file. This is wonderful as an administrator. All of the logs drop into one location for easy cleanup or archival. Users can specify an alternate location if they don't want it in the default, so everyone wins.

 

31Mar/110

Making SOAP calls from SAS! Integrating with web services

One of the issues with SAS for many IT departments is the lack of integration with service oriented architecture (SOA). The good news is with many new features coming online with versions 9.X+ are service oriented.

Lets look quickly at the Proc SOAP procedure now available.

For those SAS programmers out there that aren't familiar with SOAP or services, get your basis here: SOAPUser-Basics

In a nutshell, SOAP is transporting XML data via a HTTP Post. In order to make a successful SOAP call from SAS you need a couple of things.

1. a request XML file

2. a repsonse XML file

3. a webservice URL and WSDL (Web Service Definition Language) -Think webservice users manual

Here is a simple example of a SOAP call we use on a daily job.

filename rqst_xml 'some file system reference';

* Create the XML;

data _null_;

set input_dataset;

file rqst_xml;

if first.records=1 then do;

put '<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>
<requestingSystem>SAS</requestingSystem>

<requestingFunction>DemoSasScript</requestingFunction>
</soap:Header>

<soap:Body>
<requestedData>';

end;

datasetData;

if last.records=1 then do;

put '</requestedData>
</soap:Body>

</soap:Envelope>';

end;

run;

filename rspns_xml 'some file system reference';

%let URL=http://webservice_url/service;

proc soap in=rqst_xml

out=rspns_xml

url=&url;

run;

 

Upon executing the call, you can read in the rspns_xml data with the SAS XML engine.

This is meant to be a simple example with very limited scope. Service architecture can quickly get complicated with error and condition handling. Please let us know if you need help with your SAS architecture or coding.

3Mar/110

Have you checked out RStudio?

We have a special place in our heart for the R language. Extremely powerful and compact (not a chatty language).

One of the complaints we have had with R is the crazy interface neccessary to do programming. Well that may all change.

Recenlty a small group of developer / designers got together to build an open source IDE for R called RStudio. It is worth checking out.

http://www.rstudio.org/

11Feb/110

Tech savvy? Think again..

Do you think your group is forward thinking and tech savvy?

How about your customers? They are probably smarter than you think..

Can you describe cloud computing? What about when you were 10?

Our friends over at Accenture put this together.

30Nov/100

Developing an effective contact strategy

There are few things that seperate the good marketers from the bad. In our opinion contact strategy is one of those things that few organizations understand and all should consider. When you are trying to decide who you should contact, through what channels and how many times, here are a couple of things to think about.

1. Not all customers are created equal - Nor do they have the same appetite for your marketing efforts. We recommend you spend time looking at your customers and how many times you contacted them in the past. A good cluster analysis will begin to help you understand that some groups prefer 10 'sale' messages and 2 'partner' messages before opting out. Put this cluster with other customer breakouts and you have the basis for your contact strategy.

2. Not all messages are created equal - As we eluded to above, you can not simply look at the recency and frequency of your messages to determine how much is too much. You need to understand the message types or objectives. Customers have varying appetites for your credit card solicitations and that appetite is much different from your best customer sales messages.

3. Implementing your strategy may be harder than developing it - So now you know what you want to implement. Customer segment X gets Y transactional messages a month and Z surveys a month. But how do you insure that they only get what you've prescribed? There are a variety of ways to accomplish this with either process changes and / or technology solutions (One of our favorites is Unica's Optimize.).

If you are considering a contact strategy for your organization, we would love to help you understand your customers and improve your communications.

11Nov/100

SAS / Teradata Fastexport – dbsliceparm = all

Fastexport is the fastest way to get large data out of teradata. Fastexport utilizes multiple connections to deliver data and therefore speeding up the transfer of data between Teradata and SAS.

Here are a few examples of fastexport.

/* libname statement*/

libname teradb  teradata username=&un password=&pw dbsliceparm=all;

/* explicit sql */

proc sql;

connect to teradata(username=&un password=&pw dbsliceparm=all);

<SQL STATMENT>

quit;run;

How do you know if fastexport was used?

Use this option:

options sastrace=',,,d' sastraceloc=saslog;

If it is working, you should see something in your log like:

Select was processed with fastexport.

There are many other factors that come into play if fastexport doesn't work. Check the requirements on the SAS support page for troubleshooting.

8Nov/100

Analyzing Paid/Owned/Earned Marketing

As more is written about various categories of marketing, we can't help but think analytically about the implications of approaching marketing problems given their categorical differences. Of late, much has been written about 3 specific communication or marketing types:

  1. Paid media
  2. Owned media
  3. Earned media

This breakout is logical, however any marketing breakout must be based on some common public thinking about 'channels'. Thus customers must interact and respond differently to those categories. During some of our most recent analysis, we found that applying some of our traditional segmentation matrices to the response indicators for these categories told a specific story for one client.  Various customer types respond distinctively different and to varying degrees to each type of marketing.

Now this might not be ground breaking on it's appearance, but if an organization could understand it's customer base to the point of actioning it's marketing toward the most profitable segments within each category, therefore maximizing it's return in paid, owned, and earned, great efficiencies could be made. It would be apparent which channels need the most focus and are the most profitable for an organization.

In the case of owned or earned media, organizations could save large portions of marketing dollars from being wasted in the paid category by maximizing 'word of mouth'.

Yet I digress. All this to say, understanding one's customers and the preferred and most profitable interactions of those customers is what creates efficient and effective marketing. Paid, owned and earned is no Earth shattering new marketing breakout, but if this is how marketing thinks about it's channels, it is how analytics should organize to help them understand where their attention should be focused.

4Nov/100

4 tips for integrating CRM technology

If you have worked with marketing technologies for any length of time, you've encountered this problem. How can we integrate our CRM with the rest of our organization? How does CRM interact with our call center, website, applications, database, loyalty system, etc., etc.

We've been there.

Throughout our travels, we've picked up a few tips. Hopefully they'll help you.

  1. Tight integration is dangerous. Just don't do it. - Marketing technology changes faster than fashion. Today's latest and greatest is quickly replaced with tomorrow's new market maker.
  2. Integrate through marketing concepts not technical application specs. - Abstracting technologies through the use marketing concepts like 'campaign', 'offer', 'contact history', 'registration', 'enrollment', etc. Define what these mean for the organization and build a data structure flexible enough for all applications to contribute to those concepts.
  3. Databases and services are the lifeline. - Long term success hinges on ease of use and flexibility. Simple services allow for plug and play scenarios. Well designed databases create environments that record interrelated transactions based on their role or concept. This makes business people happy. They can measure, analyze and predict without spending precious hours compiling, cleaning, and organizing data.
  4. Think replaceable. - Always remember that what you are adding to your technology stack could be replaced in a year and you will need to re-integrate something else. How much of your current work will be thrown away? Minimize the one-time development and maximize your efficiency and cost savings to the organization over the long haul.

We like to think we aren't integrating technology. We are simply making all of our applications play nicely together.

There is much more to this topic, but these 4 tips can minimize your stress for ears to come.

9Aug/102

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 another_number=.;

run;

This is the same as where number=6 and another_number=.