Sentry Page Protection
Summary
1. There are 6 attributes of a SAS variables:
It is estimated that 30% of the programming error are related to incorrect variable attributes.
Ensuring the variable has the right attribute is crucially important in SAS.
2. You can print the list of variables and its corresponding attributes by using Proc Contents.
3. Variable Name cannot:
4. Variable Label is the description of the data. It cannot be more than 256 characters.
5. There are only 2 types of variable in SAS: Numeric and Character.
Numeric variable stores numeric data and character variable stores text.
6. The variable Length is the # of bytes assigned to the variable.
You should ensure character variable has sufficient length to avoid data truncation.
7. The variable Format allows you to display the data differently than the internal values stored in SAS. Some of the more common formats are:
You can also create your own custom format using Proc Format.
8. The variable Informat identifies the form of data from a variable. It is mostly used in reading in an external file or converting a variable from character to numeric.
9. You can use:
1. There are 6 attributes of a SAS variables:
- Name
- Label
- Type
- Length
- Format
- Informat
It is estimated that 30% of the programming error are related to incorrect variable attributes.
Ensuring the variable has the right attribute is crucially important in SAS.
2. You can print the list of variables and its corresponding attributes by using Proc Contents.
3. Variable Name cannot:
- be more than 32-character long
- contain special characters (except for underscore)
- start with numbers.
4. Variable Label is the description of the data. It cannot be more than 256 characters.
5. There are only 2 types of variable in SAS: Numeric and Character.
Numeric variable stores numeric data and character variable stores text.
6. The variable Length is the # of bytes assigned to the variable.
You should ensure character variable has sufficient length to avoid data truncation.
7. The variable Format allows you to display the data differently than the internal values stored in SAS. Some of the more common formats are:
- Best.
- W.D
- DollarW.D and CommaW.D
- YYMMDD10.
- Date9.
- MMDDYY10.
You can also create your own custom format using Proc Format.
8. The variable Informat identifies the form of data from a variable. It is mostly used in reading in an external file or converting a variable from character to numeric.
9. You can use:
- PUT function to convert numeric variable into character or
- INPUT function to convert character variable into numeric