Focal Point
[SOLVED] deference of function run between 7701 and 7703

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1087071816

March 23, 2012, 02:53 AM
ozai
[SOLVED] deference of function run between 7701 and 7703
-SET &MONTH='201105';
-SET &FIRST_MONTH=&MONTH||'01';


-SET &DATE1=DATEADD(&FIRST_MONTH,'D',1);
-TYPE &DATE1
-SET &DATE2=DATEADD(&FIRST_MONTH,'M',1);
-TYPE &DATE2
-SET &DATE3=DATECVT(&DATE1,'YYMD','A8YYMD');
-TYPE &DATE3

7703:
20110502
569611005
69610906

7701:
20110502
20110601
20110601

who can tell me why?
thanks!

This message has been edited. Last edited by: Kerry,


webfocus 7701 ,windows 7 64bit ,All Output
March 23, 2012, 04:31 PM
jgelona
First DATEADD does directly work with Dialogue Manager. Neither does DATEMOV or DATEDIF. Do a search on UDATEADD. You will find a DEFINE FUNCTION that will work with Dialogue Manager. You can also create similar Functions for DATEMOV and DATEDIF.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 23, 2012, 05:16 PM
David Briars
Per the 7702 Using Functions Manual:
quote:
Do not use DATEADD with Dialogue Manager. DATEADD requires a date to be in date format; Dialogue Manager interprets a date as alphanumeric or numeric.
Perhaps take a look at the following amendments to your code:
-SET &MONTH='201105';
-SET &FIRST_MONTH=&MONTH | '01';
-TYPE &FIRST_MONTH
-*
-SET &DATE1=AYMD(&FIRST_MONTH,1,'I8YYMD');
-TYPE &DATE1
-*
-SET &DATE2=AYM(&MONTH,1,'I6YYM');
-SET &DATE2 = &DATE2 | '01';
-TYPE &DATE2
-EXIT  

Yielding:
20110501
20110502
20110601





Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
March 23, 2012, 06:17 PM
Dan Satchell
DATEADD and other SmartDate-only functions can be used in Dialogue Manager (DM), but the DM dates must first be converted to SmartDate integers with function DATECVT. Note that the DM dates must be identified as numeric and not alpha in DATECVT (I8YYMD, not A8YYMD). After performing the desired SmartDate math (DATEADD in this case), the SmartDate integers must be converted back to DM dates. But as David indicates, the legacy date functions AYMD and AYM will handle DM dates directly and do not require conversion to/from SmartDate formats.

-SET &MONTH = '201105';
-SET &FIRST_MONTH = &MONTH || '01';
-*
-SET &DATE1 = DATECVT(DATEADD(DATECVT(&FIRST_MONTH,'I8YYMD','YYMD'),'D',1),'YYMD','I8YYMD');
-SET &DATE2 = DATECVT(DATEADD(DATECVT(&FIRST_MONTH,'I8YYMD','YYMD'),'M',1),'YYMD','I8YYMD');
-*
-TYPE &DATE1
-TYPE &DATE2



WebFOCUS 7.7.05
March 25, 2012, 10:26 PM
ozai
thanks all


webfocus 7701 ,windows 7 64bit ,All Output