The DATALINES statement introduces lines of data in a DATA Step. There are two alternative statement keywords that can be used for this statement; the CARDS statement and the LINES statement.
The DATALINES statement precedes any lines of data that are going to be read into the DATA step. The lines of data that immediately follow this statement end when the first semicolon is encountered. If the data contains semicolons then the DATALINES4 statement needs to be used instead.
The DATALINES statement must be used at the end of a DATA Step after all the other statements in the data step but before the lines of data.
The terminating semicolon should be the first character on a new line and can be followed by the RUN statement.
To read the lines of data that follow the DATALINES statement the DATA step must also contain at least one INPUT statement to read the data. An INFILE statement that associates the datalines with an infile name can also be used if the data is delimited or other infile options need to be used to read the data.
Will produce the dataset LINES_OF_DATA containing
Thanks to Cameron for originally contributing this content to sasCommunity.org.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.