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
What rules are to be followed while using the corresponding options?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
What is the difference between next sentence and continue in cobol programing language?
What is the use of intialize verb?
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
What is rmode(any) ?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What are different data types in cobol?
What is the utilization of copybook in cobol?
Whats the difference between search & search ALL?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
What is the compute verb? How is it used?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
What is the difference between binary search and sequential search?