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
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)?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
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
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.
) How do u handle errors in BMS macro?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What the difference is between continue and next sentence?
example for sub strings ? and refernce modifications whit output pls
What is rmode(any) ?
What are all the divisions of a COBOL program?
Can a Search can be done on a table with or without Index?
) what is the difference between AID and HANDLE AID?
What are the various section in data division and briefly explain them.
What type of SDLC u followed? Why?
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.