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
Define cobol?
Write the code implementing the perform … varying.
i want a program using by if, evaluate , string, unstring, perform, occurs?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
how do you reference the variable unblock file formats from cobol programs
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
How many bytes S(8) comp field occupy and its maximum value?
Name some of the examples of COBOl 11?
how do you reference the variable block file formats from cobol programs
What is difference between static and dynamic call in cobol?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
When is inspect verb is used in cobol?