IGZEDT4: get current date
IGZEDT4 returns the current date with a four-digit year in the form YYYYMMDD.
- output_char_date (output)
- An 8-byte fixed-length character string in the form YYYYMMDD, which represents current year, month, and day.
Usage note: IGZEDT4 is not supported under CICS®.
Example
**************************************************
** Function: IGZEDT4 - get current date in the **
** format YYYYMMDD. **
**************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLEDT4.
. . .
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CHRDATE PIC S9(8) USAGE DISPLAY.
. . .
PROCEDURE DIVISION.
PARA-CBLEDT4.
**************************************************
** Call IGZEDT4.
**************************************************
CALL 'IGZEDT4' USING BY REFERENCE CHRDATE.
**************************************************
** IGZEDT4 has no nonzero return code to
** check, so just display result.
**************************************************
DISPLAY 'The current date is: '
CHRDATE
GOBACK.
Alternatively, you can use the ACCEPT statement to get the current date with a
four-digit year. Below is an example:
01 todays-date.
03 todays-yyyy pic 9(04).
03 todays-mm pic 9(02).
03 todays-dd pic 9(02).
. . .
accept todays-date from date yyyymmdd.