As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


DATALINES4 statement

From sasCommunity
(Redirected from CARDS4 statement)
Jump to: navigation, search

The DATALINES4 statement introduces lines of data in a DATA Step. The lines may contain embedded semicolons, which are not allowed in a standard DATALINES statement (as they typically mark the end). There are two alternative statement keywords that can be used for this statement; the CARDS4 statement and the LINES4 statement.

Syntax

DATALINES4 ;

or

CARDS4 ;

or

LINES4 ;

followed by

<any number of lines of data that may contain one or more semicolons>
;;;;
RUN statement ;

Usage

The DATALINES4 statement preceeds any lines of data that are going to be read into the DATA step. The lines of data, which may contain semicolons, that immediately follow this statement end when four consecutive semicolons are encountered on anew line. If the data itself does not contain any semicolons then the DATALINES statement can be used instead.

The DATALINES4 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, 4 consecutive terminating semicolons on a new line and the RUN statement.

To make use of the data lines the DATA step must also contain an INFILE statement that associates the Datalines4 statement's data with an infile name and at least one INPUT statement to read the data that the infile name refers to.

See also