How do you fetch current date in normal cobol pgm and in
cobol-db2 pgm?
Answers were Sorted based on User's Feedback
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 |
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 |
How are the next sentence and continue different from each other?
HOw can I get the negative sign while deduct high value from low value
Which Search verb is equivalent to PERFORM…VARYING?
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
How do you reference the following file formats from cobol programs?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
How to open and see copy book ?
How do we get current date from system with century in COBOL?
How to read a 100 record from a file through cobol?
How many maximum number of procedures can we write in one COBOL program?
what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.
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