FORMATTIME - IBM Mainframe

The FORMATTIME command will transform the absolute date and time (normally produced from the CICS command ASKTIME using the ABSTIME option) into any one of a number of the optional formats listed below. The syntax of the command is

FORMATTIME

FORMATTIME

Various options of the command are explained below:

  • ABSTIME (data_area) - Packed decimal (PIC S9(15) COMP-3) field containing the absolute time in milliseconds since 0000 hours on January 1, 1990 that is to be converted into another format. An invalid absolute time will generate an INVREQ error.
  • DATE (data-area) - Character field (8 bytes) returning the date according to the specified DATFORM parameter set in the CICS system initialization table (SIT). The separator is included in the returned date when the DATESEP option is specified. This option is generally used for output purposes only, if analysis is required on the date as in comparisons, then another option should be used in returning the date in an explicit form, for example, using the MMDDYY option.
  • DATE FORM (data_area) - Character field (6 bytes) returning the date format defined by the CICS installation according to the DATFORM option of the CICS system initialization parameter (SIT table). The DATFORM has 3 options of which only one is defined in the SIT. (YYMMDD, DDMMYY, or MMDDYY). The DATE option must also be used in conjunction with this option.
  • DATESEP (datavalue) - Character field (V byte) containing the separator character for the date format. The separator character is inserted between the day, month, and year values. If this option is specified without a data_value then the slash (/) is the default. If this option is omitted completely from the command, then no separator is used.
  • DAY COUNT (data_area) - Fullword binary (PIC S9(8) COMP).number field containing the number of days that have passed since the first day (Jan 1, 1990). Useful in comparing dates between two of more items.
  • DAY OF MONTH (dataarea) - Fullword binary (PIC S9(8) COMP) number field containing the number of the day in the month.
  • DAY OF WEEK (data_area) - Fullword binary (PIC S9(8) COMP) number field containing the relative day number of the week. (Ex. Sunday=0, Saturday=6)
  • DDMMYY (data_area) - Character field (8 bytes) that returns the date in the format of day/month/year {Ex. 15/09/92).
  • MMDDYY (data_area) - Character field (8 bytes) that returns the date in the format of month/day/year (Ex. 09/15/92).
  • MONTH OF YEAR (data_area) - Fullword binary (PIC S9(8) COMP) number field containing the relative month number of the year. (Ex. January=1, December=12).
  • TIME (data_area) - Character field (8 bytes) that returns the 24 hour clock time in the format hh:mm:ss where the separator (:) is defined by the TIMESEP option. If the TIMESEP option is omitted then only a 6-character value representing the time is returned without separators (hhmmss). ;
  • TIMESEP (datavalue) - Character field (1 byte) containing the separator character for the time format. The separator character is inserted between the hours, minutes, and seconds values. If this option is specified! without a data_value then the slash (:) is the default. If this option is omitted completely from the command, then no separator is used and 6 bytes are returned without a separator (Ex. hhmmss).
  • YEAR (data area) - Fullword binary (PIC S9(8) COMP) 4 figure number field containing the year (Ex. 1992, 1991).
  • YYDDD (data area) - Character field (6 bytes) that returns the date in the format of year/day (Ex. 92/245).
  • YYDDMM (dataarea) - Character field (8 bytes) that returns the date in the format of year/day/month (Ex. 92/15/09).
  • YYMMDD (data_area) - Character field (8 bytes) that returns the date in the format of year/month/day (Ex. 92/09/15).
  • Handle Conditions:
  • INVREQ - Value passed to the command in the data_area contains an incorrect form for command processing. -Occurs also when the ABSTIME option used contains an incorrect form. The default action is the abnormal termination of the task.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics