Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 do you understand by psb and acb?

0 Answers  


Can we put move statement in COBOL copybook

3 Answers   Global Logic,


I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. 05. C PIC X(3). 05. D PIC X(3). 05. E PIC 9(3). IN MY PROG, I HAVE MOVE 1 TO E. DISPLAY A. WHAT WILL BE DISPLAYED AS A RESULT OF THIS? PLEASE EXPLAIN THE ANSWER. THANKS.

7 Answers   Amdocs,


What are the divisions in a cobol program?

1 Answers  


can we display comp-3 variables. if we want to display what we have to do . give me one example

6 Answers   CGI, Deloitte,


I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?

1 Answers  


01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q + r what will be result of p ans(00) but my question is that how i got 10 on the place of 00. (truncation will ocuure on right side not left). please tell me ?

6 Answers   L&T,


How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.

1 Answers   Syntel,


How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB

6 Answers   Polaris,


ZEROES and SPACES are _______ constants (a) Figurative (b) Numeric (c) Non-numeric (d) Alphabete

4 Answers   TCS,


What is COMP SYNC?

3 Answers  


what is the difference between occurs and occurs depending on? i dont think so there is the difference in storage..then why we should use occurs depending on?

9 Answers   TCS, Tech Mahindra,


Categories