Mike's SAS Tutorials Lesson 2
This video series is intended to help you learn how to program using SAS for your statistical needs. Lesson 2 introduces some basic data step programming to define variables and specify their values for data sets containing one or more observations.
I also introduce two procedures: the PRINT procedure (PROC PRINT) to display the data contents in the OUTPUT window, and the CONTENTS procedure (PROC CONTENTS) to summarize the data set. Finally, I introduce the concept of libraries to show another method of inspecting the data set by physically opening it from the temporary WORK library.
Helpful Notes:
1. PROC PRINT - displays the entire data set by observation in the OUTPUT window
2. PROC CONTENTS - summarizes the properties of a data set, including an alphabetic listing of the variables and a count of the number of observations.
3. The assignment operator ("=") directly specifies the value of a variable in the data step.
4. The INPUT statement defines one or more variables of our data set.
5. The CARDS statement specifies the values for each of the INPUT variables (in order).
6. It is a good rule of thumb to always pair the INPUT and CARDS statements together.
7. DON'T FORGET SEMI;COLONS! They end statements and without them, you will most certainly have errors arise.
8. If you have any errors, always, ALWAYS, ALWAYS check the LOG first!
9. Creating datasets "on-the-fly" just means you're making a new dataset without bringing in the data from any other source.
Today's Code:
data main;
input x y z;
cards;
1 2 3
7 8 9
;
run;
proc print data=main;
run;
proc contents data=main;
run;
WE NEED PART 3! MIKE, COME BACK TO US!
ctooshi 4 months ago
@ctooshi Click on my channel to check out lesson 3 - more videos on the way soon :)
mbate001 4 months ago