Sunday, February 13, 2011

Creating a SAS file after importing data into SAS

There are a few ways to do this. For me I usually just read the data in and work from there, (refer to Question 1 of Assignment 1 for how to read in the GunDeaths file)

If you import the data, then after your data is imported successfully, SAS will create a temporary SAS file in the WORK folder. From there, you can perform one of the two actions below to obtain that temporary SAS file:
1. Upload the data file to the SAS Server or
2. Down load the data file to your PC (recommended)

To Download Data file to your PC, follow the two steps in the wizard. To do this, in the OuputData, select Data, then select Download Data Files to PC and follow the steps:

Step 1: "Select the SAS data file to copy to your PC"
  • Click on ADD
it will take you to a folder called WORK.
In this WORK folder you should see the name of the file that you imported,
say MyFile. SAS creates a genuine SAS file with the same name with the ending .sas7bdat.
Your new file will be MyFile.sas7bdat
  • Select the SAS file and click OPEN
  • Click NEXT to go to the second step
Step 2: "Select the folder for the SAS data set on your PC
  • Click on Browse to save the file in your desired folder, say MyFolder
  • Select Finish
You now have a SAS file MyFile.sas7bdat in MyFolder. You can open or read this file into SAS.

1 comment:

  1. Thank you very much Trang. It's bee of great help for me.

    ReplyDelete