x
Get Certified as a SAS Base Programmer
28
Training Modules |
200+
Exam Questions |
100%
Instructor Support |
100%
Pass Guarantee |
|
Lesson 1.2: Multiple Variables?
IMPORTANT! We have recently updated our training materials. Check out the latest free training here. More often than not, we want the dataset to include more than 1 variable. We can use the ‘input’ and ‘datalines’ statements to create it:
This example illustrates how to create a dataset with more than 1 variable: Example DATA SASCrunch; INPUT name $ dept $; DATALINES; John Sales Mary Acctng ; RUN; Let’s break down the codes above.
(1) The INPUT statement assigns names to the two variables created. The first variable is called ‘name’ and the second one is called ‘dept’. (2) The DATALINES statement tells SAS the next line of codes should be read in as data as opposed to the programming codes. (3) These are the data that are to be read in. Now, let’s take a look at the dataset that we have just created: DONE! You have learned to check programming errors in SAS.
Note:
|
|