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 to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
How do define dynamic array in cobol.
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
What are the different rules of SORT operation?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
Write some characteristics of cobol as means of business language.
IF I mention stop run in CICS what happens?
What rules are to be followed while using the corresponding options?
Can we redefine the field of x(200) to less than 200?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
What is the difference between perform … with test after and perform … with test before?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What are the pertinent COBOL commands?
What is the problem of ordered sequential files access?
What is the difference between binary search and sequential search?