Suppose you have a list of variables. You don’t want to type the name of each variable every time to define them within the function or array. You are looking for a shortcut to accomplish this task.
Create a dataset with a list of variables
How to specify a list of variables
A single dash (-) refers to specify consecutive numbered variables. For example: a1-a4;
A double dash (–) refers to specify variables based on the order of the variables as they appear/entered in the file, regardless of the name of the variables.
In the above program, a1-a4 includes a1, a2, a3 and a4, whereas a1--a4 includes a1, a3 and a4 only as they appear the same way in file.
How to specify all NUMERIC variables
How to use double dash in array
The below-defined program will subtract one from values in variables a1, a3 and a4.
How to use numeric variables in array
The below-defined program will subtract one from values in numeric variables.
- How to drop variables from a dataset in SAS Programming?
- How to import data into SAS?
- Introduction to SAS programming
- How to import External Data from Excel or Text file into SAS Programming?
- How to Create or Modify a Variable in SAS Programming?
- Contains and Between-And operators in SAS Programming
- Where Statement in SAS Programming
- If-Then-Else statement in SAS Programming
- IS MISSING and IS NOT MISSING Operators in SAS Programming
- Like Operator in SAS Programming
- SAS | How to read character of varying length using COLON Modifier
- SAS | How to read character using Ampersand(&)
- SAS | Date Formats and Informats
- SAS | Delete Empty Rows
- SAS | COALESCE Function with Examples
- SAS : How to Display Current Date?
- SAS | COMPRESS Function with Examples
- C# | Variables
- JS++ | Variables and Data Types
- How to avoid Compile Error while defining Variables
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.