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


Please Help Members By Posting Answers For Below Questions

Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

834


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1047


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

2214


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6069


) How do u handle errors in BMS macro?

1606






How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

893


What the difference is between continue and next sentence?

856


example for sub strings ? and refernce modifications whit output pls

2057


What is rmode(any) ?

886


What are all the divisions of a COBOL program?

868


Can a Search can be done on a table with or without Index?

1034


) what is the difference between AID and HANDLE AID?

1868


What are the various section in data division and briefly explain them.

900


What type of SDLC u followed? Why?

1713


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3931