Function SET165A - Demonstrate OV_DATETIME_DIFF

LANSA

Function SET165A - Demonstrate OV_DATETIME_DIFF

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_165);
********** COMMENT(Function .......: SET165A);
********** COMMENT(Created on .....: 21/01/00 at 14:43:32);
********** COMMENT(Description ....: Test Date Time BIF);
********** COMMENT(Version.........: 1);
**********;
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(demonstrate built-in function OV_DATETIME_DIFF);
**********;
********** COMMENT(Disclaimer: The following material is supplied as);
********** COMMENT(sample material only. No warranty concerning the);
********** COMMENT(material or its use in any way whatsoever is);
********** COMMENT(expressed or implied.);
**********;
********** COMMENT(Minimum LANSA release: 8.0);
**********;
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT);
**********;
********** COMMENT(Group and field definitions);
**********;
DEFINE FIELD(#S_165FDAT) TYPE(*DEC) LENGTH(6) DECIMALS(0) DESC('From Date') EDIT_CODE(Y);
DEFINE FIELD(#S_165FFMT) TYPE(*CHAR) LENGTH(20) DESC('Format of from-date') DEFAULT(SYSFMT);
DEFINE FIELD(#S_165FTIM) TYPE(*DEC) LENGTH(6) DECIMALS(0) DESC('From Time (HHMMSS)');
DEFINE FIELD(#S_165TDAT) TYPE(*DEC) LENGTH(6) DECIMALS(0) DESC('To Date') EDIT_CODE(Y);
DEFINE FIELD(#S_165TFMT) TYPE(*CHAR) LENGTH(20) DESC('Format of to-date') DEFAULT(SYSFMT);
DEFINE FIELD(#S_165TTIM) TYPE(*DEC) LENGTH(6) DECIMALS(0) DESC('To Time (HHMMSS)');
********** COMMENT(returned fields);
DEFINE FIELD(#S_165DIFF) TYPE(*DEC) LENGTH(15) DECIMALS(0) DESC('Time difference in seconds') EDIT_CODE(M);
DEFINE FIELD(#S_165RET) TYPE(*CHAR) LENGTH(2) DESC('Return Code');
********** COMMENT(Mainline);
**********;
**********;
BEGIN_LOOP;
REQUEST FIELDS(#S_165FDAT #S_165FFMT #S_165FTIM #S_165TDAT #S_165TFMT #S_165TTIM (#S_165DIFF *OUTPUT) (#S_165RET *OUTPUT)) IDENTIFY(*DESC);
USE BUILTIN(OV_DATETIME_DIFF) WITH_ARGS(#S_165FDAT #S_165FFMT #S_165FTIM #S_165TDAT #S_165TFMT #S_165TTIM) TO_GET(#S_165DIFF #S_165RET);
END_LOOP;