Function SET167A - Demonstrate OV_MONTH_LASTDAY

LANSA

Function SET167A - Demonstrate OV_MONTH_LASTDAY

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_167);
********** COMMENT(Function .......: SET167A);
********** COMMENT(Created on .....: 21/01/00 at 14:43:32);
********** COMMENT(Description ....: Test the last day of the month BIF);
********** COMMENT(Version.........: 1);
**********;
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(demonstrate built-in function OV_MONTH_LASTDAY);
**********;
********** 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_167FDAT) TYPE(*DEC) LENGTH(6) DECIMALS(0) DESC('Input Date') EDIT_CODE(Y);
DEFINE FIELD(#S_167FFMT) TYPE(*CHAR) LENGTH(20) DESC('Format of input date') DEFAULT(SYSFMT);
DEFINE FIELD(#S_167TFMT) TYPE(*CHAR) LENGTH(20) DESC('Format of last day date') DEFAULT(YYYYMMDD);
********** COMMENT(returned fields);
DEFINE FIELD(#S_167TDAT) TYPE(*DEC) LENGTH(8) DECIMALS(0) DESC('Last day of the month');
DEFINE FIELD(#S_167RET) TYPE(*CHAR) LENGTH(2) DESC('Return Code');
********** COMMENT(Mainline);
**********;
**********;
BEGIN_LOOP;
REQUEST FIELDS(#S_167FDAT #S_167FFMT #S_167TFMT (#S_167TDAT *OUTPUT) (#S_167RET *OUTPUT)) IDENTIFY(*DESC);
USE BUILTIN(OV_MONTH_LASTDAY) WITH_ARGS(#S_167FDAT #S_167FFMT #S_167TFMT) TO_GET(#S_167TDAT #S_167RET);
END_LOOP;