What’s New in SAS 9.4 DATA Step Statements
Overview
This document supports
DATA step statements for SAS 9.4 and SAS Viya.
A highlighted, abbreviated
notation of the SAS version and maintenance release specifies when
a feature was added to SAS. For example, SAS 9.4M6 indicates
that a feature was added during the sixth maintenance release of SAS
9.4.
Beginning in SAS
Viya 3.5, the DESCENDING option is supported in
a DATA step that runs in CAS. When running in CAS, the DESCENDING
option cannot be used on the first variable in the BY statement.
In the May 2019 release
of SAS 9.4M6 and SAS
Viya 3.4, the STATUS option is now documented for
the INFILE statement.
These are the new and
enhanced features for SAS 9.4M6:
- The WHERE statement
can be specified in a DATA step that is running in CAS.
- You can enable the LIST
statement to write log data in hexadecimal format using the HEXLISTALL
argument in the DATA statement.
In SAS
Viya 3.4, these statement options are now documented:
- The MEMVAR option is
documented for the INFILE and FILE statements.
- The RESET option is
documented for the INFILE statement.
Beginning in SAS
9.4M5, global statements are available in the new SAS Global Statements: Reference.
New and enhanced features
enable you to perform these tasks:
- create and name a variable
that contains the observation number that was just read from the data
set
- control whether a KEY=
search should begin at the top of the index for the data set that
is being read
Enhanced SAS DATA Step Statements
In SAS
Viya 3.5, the SAS DATA step statement is enhanced:
- BY
-
- The DESCENDING option
in the BY statement is now supported for a DATA step that is running
in CAS. The option is supported only for the second and subsequent
variables in a CAS DATA step and not for the first variable in a BY
statement. See SAS Cloud Analytic Services: DATA Step Programming
In SAS
Viya 3.4, these SAS DATA step statements are enhanced:
- FILE
-
- The MEMVAR option specifies
a file to open. When the value of the MEMVAR= variable changes, the
current file is closed and the new file is opened.
- INFILE
-
- The MEMVAR option enables
you to open the individual files contained in a directory or contained
in a directory-based file such as a ZIP file.
- The RESET option specifies
whether to close the current input file and open a new file, or close
and reopen the current input file.
In SAS
9.4, these SAS DATA step statements have been enhanced:
- INFILE
-
- SAS automatically normalizes
imported copies of files that are created in Windows that are being
read by SAS when you are running your session in UNIX. This enables
easier sharing of files between the environments.
- MODIFY
-
-
- A new option, CUROBS,
creates and names a variable that contains the observation number
that was just read from the data set.
- A new option, KEYRESET,
controls whether a KEY= search should begin at the top of the index
for the data set that is being read. When the value of the KEYRESET
variable is 1, the index lookup begins at the top of the index. When
the value of the KEYRESET variable is 0, the index lookup is not reset
and the lookup continues where the prior lookup ended.
- SET
-
-
- A new option, CUROBS,
creates and names a variable that contains the observation number
that was just read from the data set.
- A new option, KEYRESET,
controls whether a KEY= search should begin at the top of the index
for the data set that is being read. When the value of the KEYRESET
variable is 1, the index lookup begins at the top of the index. When
the value of the KEYRESET variable is 0, the index lookup is not reset
and the lookup continues where the prior lookup ended.
Last updated: June 17, 2025