You must have Javascript enabled to experience this site.

Using date functions in Dialogue Manager

Posted & filed under Coding Tips.

WebFOCUS Functions can be called from DM (with some restrictions). This allows dates to be manipulated or converted.

There are two types of date functions: Standard and Legacy. Only the Legacy functions (eg: AYMD) are directly compatible with DM. The standard functions can be used, but the date has to be converted to an offset first, then converted back afterwards. Example code (to add 14 days to a date) and output below.

 

-* DM date example
-SET &ECHO = 'ALL';
-SET &OUTDATE = AYMD(2O111012, 14, 'I8');
-TYPE &OUTDATE

-SET &OFFSET = DAYMD(2O111012, 'I8');
-SET &NEWOFF = DATEADD(&OFFSET, 'D', 14);
-SET &NEWDT = DTYMD(&NEWOFF, 'I8');
-TYPE &NEWDT
-RUN
-EXTT

 

Output


-SET &OUTDATE = AYMD(2O111012, 14, 'I8');
-TYPE 20111026
20111026

-SET &OFFSET = DAYMD(2O111O12, 'I8');
-SET &NEWOFF = DATEADD(40827, 'D', 14);
-SET ENEWDT = DTYMD(40841, 'I8');
-TYPE 20111026
20111026
-RUN
-EXIT

 

 

Refer to the Using Functions manual

Calling a Function From a Dialogue Manager Command (p62)
Using Standard Date Functions (p205)
Using Legacy Date Functions (p247)
DA Functions: Converting a Legacy Date to an Integer (p256)
DT Functions: Converting an integer to a Date (p261)

 

 

 

4 views