Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_dttmfmts.sas File Reference

Returns the SAS format names that carry a date, datetime or time value. More...

Go to the source code of this file.

Detailed Description

Prints a quoted, comma separated list of format NAMES, for use in open code or in generated code:

if upcase(fmt) in (%mf_dttmfmts(DATE)) then fmttype='DATE';
else if upcase(fmt) in (%mf_dttmfmts(DATETIME)) then fmttype='DATETIME';
else if upcase(fmt) in (%mf_dttmfmts(TIME)) then fmttype='TIME';
else fmttype='NUM';

The names carry no width or decimal suffix, so strip that first (eg DATE9. becomes DATE). This macro is the single source of truth for the lists - mcf_getfmttype.sas builds its FCMP lookups from it.

Parameters
[in]typeDATE / DATETIME / TIME (case insensitive)

SAS Macros

Related Macros

Version
9.4
Author
Allan Bowe

Definition in file mf_dttmfmts.sas.