Credit Card Project [4-6]

Now that we have the promotion leads, we will have to send the leads across to the marketing team to do the promotion.

The thing is, they have no access to SAS.

We will have to send the leads in a text file.

Before we learn how to export the leads to a text file, let's quickly go through how to access a local drive from your SAS University Edition software.

The SAS University Edition software runs on a virtual machine, which is considered a separate operating system.

You cannot directly export data to any folder of your local drive (such as C drive). 

You can export data only to a folder that is shared by both the local computer and the virtual machine.

This folder is called a "shared folder" and the path is "/folders/myfolders"

For more information about how to access files through shared folders, please visit Data Set [9-14]


Now, let's assume you have enabled the shared folder in your SAS University Edition software. 

Let's first create a sub-folder called "Projects" in the "myfolders" folder.

You then create a sub-folder called "Credit Card".

myfolders > Projects > Credit Card

In order for us to save the leads in this folder, we will first create a file reference in SAS using the Filename statement.

filename lead1 '/folders/myfolders/Projects/Credit Card/lead1.txt';

​The Filename statement above creates a file reference called Lead1.

The Lead1 file reference is the name reference for the Lead1.txt file in the shared folder. 

Please note that the lead1.txt file does not exist yet. 
 
We simply created a file reference without creating any files.
 
Now, we will write the leads to the text file using the data step below:

data _null_;
set lead1;
file lead1;
put @1 custno @20 Promo_name;
run;

This data step is fairly simple. 
 
The File statement tells SAS to write the output to the Lead1 file reference. 

The Put statement tells SAS which variables and which position to write the values.

In this example, the Custno variable is written starting in the first column, and the Promo_name variable is written starting at the 20th position.

The text file is now created!

​The text file contains the two columns that we included:

Done! We can now send this file to the marketing team, and start the promotion!

The promotion will include an email marketing campaign, tele-marketing and Facebook marketing.​