Identifying Character Variables and Expressing Character Values
To store character values in a SAS data set, you need
to create a character value. One way to create a character variable
is to define it in an input statement. Simply place a dollar sign
after the variable name in the INPUT statement, as shown in the DATA
step that created AIR.DEPARTURES:
input Country$
1-9 CitiesInTour 11-12 USGate$
14-26 ArrivalDepartureGates$
28-48;
You can also create a
character variable and assign a value to it in an assignment statement.
Simply enclose the value in quotation marks:
Schedule = '3-4 tours per season'
;
Either single quotation marks (apostrophes) or double quotation marks are acceptable. If the value itself contains a single quotation mark, ...
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.