Chapter Contents

Previous

Next
SASDATEFMT=

SASDATEFMT=



Changes the SAS format that is associated with a DBMS column.

Default value: None


Syntax
Details
Example 1: Converting a SAS Datetime Type to a Teradata Date Type
Example 2: Converting a Teradata Date Type to a SAS Datetime Type

Syntax

SASDATEFMT=(<DBMS-date-col-1='SAS-date-format'> <... <DBMS-date-col-n='SAS-date-format'>>)

DBMS-date-col
specifies the name of a Teradata table column that is a date type.

SAS-date-format
specifies a SAS date format that has a like-named informat.

For example, DATETIME21.2 is both a SAS format and SAS informat. It is an example of a valid value for the SAS-date-format argument.


Details

When a SAS date, datetime, or time variable type does not match the type of the corresponding Teradata column, you must use SASDATEFMT= to convert the SAS type to the Teradata type. If the SAS and Teradata type match, the option is unnecessary.

For more information on the SASDATEFMT= option, see SASDATEFMT=.

Example 1: Converting a SAS Datetime Type to a Teradata Date Type

libname x teradata user=kamdar password=ellis;
proc sql noerrorstop;
 create table x.dateinfo ( date1 date );
 insert into x.dateinfo 
   ( sasdatefmt=( date1='datetime21.') )
     values ( '31dec2000:01:02:30'dt ); 

In this example, SASDATEFMT= correctly converts DATE1, a SAS datetime value, to a Teradata date column named DATE1.

Example 2: Converting a Teradata Date Type to a SAS Datetime Type

libname x teradata user=kamdar password=ellis;
data sas_local;
format date1 datetime21.;
set x.dateinfo( sasdatefmt=( date1='datetime21.') );
run;

In this example, SASDATEFMT= correctly converts DATE1, a Teradata date column, to a SAS datetime type named DATE1.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.