Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mcf_getfmttype.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mcf_getfmttype.sas macro
4
5 <h4> SAS Macros </h4>
6 @li mcf_getfmttype.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12%mp_assertscope(SNAPSHOT)
13%mcf_getfmttype()
14%mp_assertscope(COMPARE,ignorelist=SASJS_FUNCTIONS)
15
16%mp_assert(
17 iftrue=(%sysfunc(mcf_getfmttype(DATE9.))=DATE),
18 desc=Check DATE format
19)
20%mp_assert(
21 iftrue=(%sysfunc(mcf_getfmttype($6))=CHAR),
22 desc=Check CHAR format
23)
24%mp_assert(
25 iftrue=(%sysfunc(mcf_getfmttype(8.))=NUM),
26 desc=Check NUM format
27)
28%mp_assert(
29 iftrue=(%sysfunc(mcf_getfmttype(E8601DT))=DATETIME),
30 desc=Check DATETIME format
31)
32
33/* these prove the lookups really come from mf_dttmfmts - neither name starts
34 with DATE / TIME, so a prefix test would not find them */
35%mp_assert(
36 iftrue=(%sysfunc(mcf_getfmttype(MMDDYY9.))=DATE),
37 desc=Check date format that is not DATE-prefixed
38)
39%mp_assert(
40 iftrue=(%sysfunc(mcf_getfmttype(HHMM8.))=TIME),
41 desc=Check time format that is not TIME-prefixed
42)
43
44/* test 2 - compile again test for warnings */
45%mcf_getfmttype()
46
47%mp_assert(
48 iftrue=(&syscc=0),
49 desc=Check syscc=0 after re-initialisation
50)