Creating a Data Set
You can create a data set using a set of code called DATA Step.
Example
Data Test;
a = 1;
Run;
DATA Step is fairly simple.
It starts with the syntax 'Data' and ends with 'Run'.
Each line in SAS ends with a semi-colon.
You can create contents for the data set within the DATA Step.
Now, run the Data Step from the example above.
This should create a data set called TEST that can be found from the WORK library.
A variable called a is also created in the TEST data set containing a single value of 1.
? Sign up for a free SASCrunch account now and keep track of your learning progress!
Exercise
Create a data set that contains the following 3 variables:
Var1 = 123
Var2 = 356
Var3 = 923
Name the data set as Number.
Need some help?
SOLUTION:
Data Number;
Var1 = 123;
Var2 = 356;
Var3 = 923;
Run;
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |