SAS Institute. The Power to Know

SAS/ACCESS(R) 9.2 Interface to PC Files: Reference

space
Previous Page | Next Page

The LIBNAME Statement for PC Files on Microsoft Windows

SASDATEFMT= Data Set Option



Changes the SAS date format of a data source column.
Valid in: DATA and PROC steps (when accessing PC files data using SAS/ACCESS software)
Default value: none

Syntax
Syntax Description
Details

Syntax

SASDATEFMT=(data-source-date-column-1='SAS-date-format'<... data-source-date-column-n='SAS-date-format'>)

Syntax Description

data-source-date-column

specifies the name of a date column in a data source table.

SAS-date-format

specifies a SAS date format that has an equivalent (like-named) informat. For example, DATETIME21.2 is both a SAS format and a SAS informat, so it is a valid value for the SAS-date-format argument.


Details

If the date format of a SAS column does not match the date format of the corresponding data source column, you must convert the SAS date values to the appropriate data source date values. The SASDATEFMT= option enables you to convert date values from the default SAS date format to another SAS date format that you specify.

Use the SASDATEFMT= option to prevent date type mismatches in the following circumstances:

  • during input operations to convert data source date values to the correct SAS DATE, TIME, or DATETIME values

  • during output operations to convert SAS DATE, TIME, or DATETIME values to the correct data source date values

If the SAS date format and the data source date format match, this option is not needed.

The default SAS date format is data source-specific and is determined by the data type of the data source column.

Note:   For non-English date types, SAS automatically converts the data to the SAS type of NUMBER. The SASDATEFMT= option does not currently handle these date types, but you can use a PROC SQL view to convert the data source data to a SAS date format as you retrieve the data, or use a format statement in other contexts.  [cautionend]

space
Previous Page | Next Page | Top of Page