Troubleshooting
Problem
This document includes an example of using the FUNCTION CURRENT-DATE in COBOL ILE.
Resolving The Problem
This document includes an example of using the FUNCTION CURRENT-DATE in COBOL ILE.
Disclaimer: This is only an example. IBM accepts no responsibility for its correctness. |
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST6.
DATE-WRITTEN. Oct 16, 2012.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS400.
OBJECT-COMPUTER. IBM-AS400.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 WS-CURRENT-DATE-DATA.
05 WS-CURRENT-DATE.
10 WS-CURRENT-YEAR PIC 9(04).
10 WS-CURRENT-MONTH PIC 9(02).
10 WS-CURRENT-DAY PIC 9(02).
05 WS-CURRENT-TIME.
10 WS-CURRENT-HOURS PIC 9(02).
10 WS-CURRENT-MINUTE PIC 9(02).
10 WS-CURRENT-SECOND PIC 9(02).
10 WS-CURRENT-MILLISECONDS PIC 9(02).
PROCEDURE DIVISION.
MAIN-LINE SECTION.
0000.
PERFORM A-INIT.
PERFORM B-MAIN.
9999.
STOP RUN.
A-INIT SECTION.
A-100.
B-MAIN SECTION.
B-100.
MOVE FUNCTION CURRENT-DATE to WS-CURRENT-DATE-DATA
DISPLAY WS-CURRENT-DATE-DATA.
[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming (Languages- compilers- tools)","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Historical Number
649094873
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1010731