COBOL - Funções intrínsecas - FORMATTED-DATE



Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

COBOL - Funções intrínsecas - FORMATTED-DATE
Intrinsic functions - Enterprise COBOL for z/OS 6.3.0

The FORMATTED-DATE function converts a date from its integer date form to the requested format.

The function type depends on the type of argument-1 as follows:

Table 1. FORMATTED-DATE function type depending on the argument-1 types

argument-1 type Function type
Alphanumeric Alphanumeric
National National
UTF-8 UTF-8

argument-1
Must be a national, a UTF-8 or an alphanumeric literal.
The content of argument-1 must be a date format.

argument-2
It must be in integer date form.
A value in integer date form is a positive integer that represents a number of days succeeding 31 December 1600, in the Gregorian calendar.
It is based on a starting date of Monday, 1 January 1601 and integer date 1 represents Monday, 1 January 1601.
The INTDATE compiler option affects the starting date for the integer date functions. For details, see INTDATE.

The returned value is a representation of the date contained in argument-2 according to the format in argument-1.

Example

Given the date format "YYYYMMDD" and the value "143951", which represents the date 15 February 1995, the returned value would be "19950215".



© Copyright IBM Corp.