We can use ampersand (&) to notify SAS to read the variable until there are two or more spaces encounter as a delimiter. This technique is always useful when the variable contains two or more words.
Actual Input: "Geeks for Geeks" Expected Input: "GeeksforGeeks"
Example 1: There are 2 spaces before 25, 32 and 30 in example code below.
Example 2: When a variable contains 2 or more than 2 words.
- In this scenario, we have a space between First Name and Last Name and we want to store both the first and last names in a single variable.
In this case, Colon modifier (:) does not work for a variable having multiple words.
- SAS | How to read character of varying length using COLON Modifier
- 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
- How to drop variables from a dataset 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 specify a list of Variables?
- 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
- Find Location and Character Vector of an Object with partial name in R Language - apropos() and find() Function
- Automate mouse events using Java Robot Class
- SQL using C/C++ and SQLite
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.