BUS5CA Customer Analytics and Social Media
Semester 2 2020
Assignment 1: Additional Technical Notes
A. How to Import CSV or XLSX file to a SAS Library
There are two way to help you achieve this.
First way is to import the csv or xlsx file with the File Import Node and save it as a sas source file format “.sas7bdat”. And then you can follow the workshop procedures to import the file and do further analysis. Another way is to import the file with the File Import node and treated directly as a data source. Note: you need to remember to set the roles for all variables in the imported data set before any further analysis.
a) Import and Save Data
1. Create the folder C:......Dataset in your local machine.
2. Copy your csv file to the folder.
3. Open your project in SAS Enterprise Miner.
4. Open Project Start Code in project Properties and type the following command: libname DATA -C:......Dataset-;
5. (This will map your folder to the SAS Library DATA. Note that the folder path must be the path of the folder that you created.)
6. Click Run Now, and then click Click OK to close the Project Start Code dialog box.
7. Create a new diagram.
8. Click the Sample tab and drag a File Import node into the diagram workspace.
9. Click the Utility tab and drag a Save Data node into the diagram workspace.
10. Link them.
11. Select File Import node and from properties click … in Import File.
12. Browse and select your xlsx file of the dataset and Click OK to exit File Import window.
13. Select Save Data node and from properties click … in SAS Library Name and then Select SAS Library DATA and click Ok to exit.
14. Select Save Data node and in properties select Filename Prefix and provide a name to the output file e.g., dataset_sas.
(Note that SAS seems to have an issue with lengthy names so better keep it short.)
15. Right Click on Save Data node and select run.
These steps will create a dataset_sas.sas7bdat file inside C:......Dataset and also add the dataset into the SAS Library: DATA.
b) Import and Use the data Directly
You can just follow the steps in a) to import the csv or xlsx data, but instead of saving the data with the Save Data node, you can directly use it as a data source and connect to other nodes for further analysis, just as shown in the diagram below. Note that you still need to set a role for each variable before any further analysis (the same as what you do in a data source node).
B. How to Create a SAS Model Package
1. Open your Assignment 1 project and diagram.
2. Highlight the last node in the diagram. (Although it has not been specifically mentioned, you should have created a model comparison node and linked the different models to this node). Therefore, the model comparison node will be the final node.
3. Select Actions= Create Model Package from the menu on the top. In the input dialog box provide a name for the model package. To ensure that you have a unique filename, include your student id as a prefix to Assignment 1 model package ( student_id _Assignment1 i.e. your student_id underscore Assignment1 should be the name of your Model package.)
4. When model package generation completed, select OK.
5. The model package now appears under the project in the top left hand corner of screen.
6. Right click on the model package you have created and then click ‘Save As’. You will be prompted to save the model as a SAS Package File (.spk) – can be saved in your hard drive.
C. How to create the .zip folder for SAS Sentiment Analysis Studio project
1. Open the directory where you have saved your project.
2. The project files contain project_name .xml file and a folder called ‘WorkShop’ for example.
3. Compress them to a folder and create a .zip file