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 |
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(9) VALUE SPACES. 01 WS-VARN REDEFINES WS-VARX PIC 9(9).
What do you do to resolve SOC-7 error?
Explain complete concept of table handling in COBOL with an example?
Study the DATA DIVISION entries and the three PROCEDURE DIVISION entries given below: 01 END-OF-FILE-SWITCH PIC XXX. 88 NO-MORE-RECS VALUE "YES". 88 MORE-RECS VALUE "NO". (i) READ SAMPLE-FILE AT END MOVE "YES" TO NO-MORE-RECS. (ii) IF NO-MORE-RECS = "YES" GO TO LAST-PARA. (iii) IF NO-MORE-RECS GO TO LAST-PARA. Which are wrong? (a) (i) and (ii) (b) (ii) and (iii) (c) (i) and (iii) (d) all
if one main program ,n -subprograms are then which call you follow ?why reasonuhg
Can we move X(7) to S9(7) COMP?
what is the advantage of using redefines instead of delaring the variables ?
What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?
01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to display the value of NAME1 in reverse order i.e value should be displayed as "GNIMMARGORP LOBOC" HOW can I do that ??? please let me know if any one knows it.
using redefine can you redefine lower variable size to higher variable size?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move 'xy' to b. display a,b.