Creating Character Variables
Unlike other programming languages such as R, Java or C++, there are only two types of variable in SAS:
Creating a character variable is easy. You simply need to enclose them with a quotation mark.
Either single quotation ('John') or double quotation ("John") works.
Data Test; Name = "John"; Class = "Mathematics";Run;
This DATA Step will create two character variables: Name and Class. They both contain character values.
Create a data set that contains the following variables:
Restaurant: Burger KingNumEmploy: 5Location: Toronto
Name the data set as Food.
Need some help?
HINT:Make sure you enclose the character data in quotation.
SOLUTION:Data Food;Restaurant = "Burger King";NumEmploy = 5;Location = "Toronto";Run;
"this is a test"
Username or Email Address
Registration confirmation will be emailed to you.