Summary -

In this topic, we described about the below sections -

Converts absolute date and time into a specified format. FORMATTIME converts the absolute date and time into any of a variety of formats. The ABSTIME argument is the value that is returned by an ASKTIME command. The ABSTIME data value can be the difference between two values that are returned by ASKTIME.

Syntax -

FORMATTIME Syntax

ABSTIME(data-area) -

Specifies the data area for the number of milliseconds since 00:00 on 1 January 1900 known as absolute time. The time returned as a packed decimal of length 8 bytes. The data-area Cobol declaration is PIC S9(15) COMP-3.

DATE(data-area) -

Specifies the variable to receive the date in the format that is specified in the DATFORM parameter. A separator is present if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field.

DATEFORM(data-area) -

Specifies the format of the installation-defined date. CICS returns YYMMDD, DDMMYY or MMDDYY according to the DATFORM parameter.

DATESEP(data-value) -

Specifies the character to be inserted as the separator between the day, month and year. And also inserted as the separator between the year and the day if form YYDDD is specified. If this option is omitted, no separator is supplied. If data-value omitted, a slash (/) is assumed as the separator.

DATESTRING(data-area) -

Specifies the 64-character user field updated by CICS with date and time stamp string in the format that is specified by the STRINGFORMAT option. If STRINGFORMAT is not specified, the default format is provided is the RFC 1123 format (RFC1123).

DAYCOUNT(data-area) -

Returns the number of days since 1 January 1900 (day 1) as a fullword binary number. This function is useful to compare the current date with a previous date.

DAYOFMONTH(data-area) -

Returns the number of the day in the month as a fullword binary number.

DAYOFWEEK(data-area) -

Returns the relative day number of the week as a fullword binary number: Sunday=0, Saturday=6. This number can be converted to a textual form of day in any language.

DDMMYY(data-area) -

Specifies the 8-character user field in which CICS returns the date in day/month/year format. A separator is added if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field.

DDMMYYYY(data-area) -

Specifies the 10-character user field in which CICS returns the date in day/month/year format. A separator is added if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 10-character user field.

FULLDATE(data-area) -

Specifies the 10-character user field in which CICS returns the date in the format specified in the DATFORM parameter with the year expanded to 4 digits.

A separator is added if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 10-character user field.

MILLISECONDS(data-area) -

Returns the number of milliseconds specified by ABSTIME as a binary integer in the range 0 - 999.

MMDDYY(data-area) -

Specifies the 8-character user field in which CICS returns the date in month/day/year format. A separator is added if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field.

MMDDYYYY(data-area) -

Specifies the 10-character user field in which CICS returns the date in month/day/year format. A separator is added if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 10-character user field.

MONTHOFYEAR(data-area) -

data-area is set to the relative month number of the year as a fullword binary number (January=1, December=12). The number can be converted to the name of the month in any language in your application program.

STRINGFORMAT(cvda) -

Specifies the format for the date and time stamp string that is returned in DATESTRING.

TIME(data-area) -

data-area is an 8-character field. data-area is set to the current 24-hour clock time in the form hh:mm:ss where the separator is provided by the TIMESEP option. The number of seconds is truncated.

TIMESEP(data-value) -

Specifies the character to be used as the separator in the returned time. If this option omitted, no separator is assumed and 6 bytes are returned in an 8-character field. If data-value omitted, a colon (:) is used as a separator.

YEAR(data-area) -

Specifies the full 4-figure number of the year as a fullword binary number.

YYDDD(data-area) -

Specifies the 6-character user field in which CICS returns the date in year/day format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 6-character user field.

YYDDMM(data-area) -

Specifies the 8-character user field in which CICS returns the date in year/day/month format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 8-character user field.

YYMMDD(data-area) -

Specifies the 8-character user field in which CICS returns the date in year/month/day format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 8-character user field.

YYYYDDD(data-area) -

Specifies the 8-character user field in which CICS returns the date in year/day format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 8-character user field.

YYYYDDMM(data-area) -

Specifies the 10-character user field in which CICS returns the date, in year/day/month format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 10-character user field.

YYYYMMDD(data-area) -

Specifies the 10-character user field in which CICS returns the date, in year/month/day format. A separator is added if requested by the DATESEP option. If no separator specified, the returned value is left-justified in the 10-character user field.

Error Conditions -

Below are the list of error conditions may occur in combination. If more than one occurs, only the first is passed to the application program.

Error ConditionRESP2, Description & SolutionSystem Action
16 INVREQ 1 - The ABSTIME value is less than zero or not in packed-decimal format.
Solution: -Modify the program logic to pass valid value to the ABSTIME.
2 - Invalid CVDA value for the STRINGFORMAT option.
Solution: -Modify the program logic to pass valid value to the CVDA.
Task abnormally terminated