How do you fetch current date in normal cobol pgm and in
cobol-db2 pgm?

Answers were Sorted based on User's Feedback



How do you fetch current date in normal cobol pgm and in cobol-db2 pgm?..

Answer / 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

How do you fetch current date in normal cobol pgm and in cobol-db2 pgm?..

Answer / v@m$i

Mr sharath small suggestion.
u r logic is correct.
but use current date instead of date in normal program.

Is This Answer Correct ?    3 Yes 1 No

How do you fetch current date in normal cobol pgm and in cobol-db2 pgm?..

Answer / adithya

procedure division.

accept a from date.

accept b from date

accept c from day-of-week

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More COBOL Interview Questions

What the difference is between continue and next sentence?

0 Answers  


HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS WHAT ARE THE VALUES WE CAN SEE IN HIGHVALUES AND LOWVALUES, CAN U PLEASE GIVE ME THE ANSWER

7 Answers   Patni,


Explain call by context by comparing it to other calls.

1 Answers  


what is Pic 9v99 Indicates?

2 Answers  


1.Can we define condition-name conditions in FD entry.

11 Answers  






i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


what is the difference between Normal vaiable and comp variable.

5 Answers   DELL,


what is SYNCHRONIZATION?

3 Answers   Syntel,


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

0 Answers  


What is difference between com and com3? Eg. s9(4) so what is the memory it will occupy com and com3.

2 Answers  


01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.

15 Answers   ACS,


Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad

35 Answers  


Categories