How do you fetch current date in normal cobol pgm and in
cobol-db2 pgm?
Answer Posted / sharath
Normal program
--------------
WORKING-STORAGE SECTION..
01 WS-DATE PIC X(6).
01 CURDATE.
05 WS-DATE-20 PIC X(2) VALUE '20'.
05 WS-DATE-YR PIC X(2).
05 FILLER PIC X(1) VALUE '/'.
05 WS-DATE-MT PIC X(2).
05 FILLER PIC X(1) VALUE '/'.
05 WS-DATE-DT PIC X(2).
PROCEDURE DIVISON..
ACCEPT WS-DATE FROM DATE
MOVE WS-DATE(1:2) TO WS-DATE-YR
MOVE WS-DATE(3:2) TO WS-DATE-MT
MOVE WS-DATE(5:2) TO WS-DATE-DT
DISPLAY CURDATE
Cobol-DB2
--------
Just writing the query..
Select CURRENT DATE into
:ws-date
from SYSIBM.SYSDUMMY
Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
How do you reference the following file formats from cobol programs?
Name the divisions, which are available in a cobol program?
Why did you choose to work with ibm mainframe cobol programming?
When is inspect verb is used in cobol?
how do you reference the variable block file formats from cobol programs
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
Why would you use find and get rather than to obtain?
How do we get current date from system with century in COBOL?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
What is the difference between next sentence and continue in cobol programing language?
What are the different rules of SORT operation?
State the various causes of s0c1, s0c5 and s0c7.
what is the use of outrecord?
What rules are followed by the search verb.