Creating a Simple - SAS Programming

For this example you use fictitious medical information data stored in a S AS data set called MEDICAL. Here is a description of the data set:

Creating a Simple

For this first example,suppose you want to generate a simple report showing all the data. Without using any options (except the data set name), you can write the world's simplest PROC PRINT code.O Actually,this is not true.You could omit the VAR statement © entirely and let the program default to all variables in the MEDICAL data set.In fact,although we frown upon this next suggestion, you can also omit the DATA= option O if the last data set created is the one you want to print. Being explicit here doesn't cost much and is a good habit to build in the great "Battle of Debug."

Example

PROC PRINT DATA=MEDICAL? O
VAR SUB_ID &
DIAGCODE
ADMITJJT
DISCHJJT
HOSPCODE
LOS
COST?
RUN;

Here is the resulting output:

Output from Example - Creating a Simple "Bare-Bones" Report

Output from Example  - Creating a Simple

As you can see, without your doing much work,PROC PRINT generates a listing of your data with a default title and variable names as column headings.Also notice that the dates are presented as SAS date values (i.e., the number of days since January 1,1960). We'll fix that shortly.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAS Programming Topics