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

Write a program to concert an Indexed file into Sequential file?

1 Answers   Covansys,


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,


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

4 Answers   TCS,


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.

11 Answers   FirstApex, NIIT,


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

0 Answers  


what is the difference between Plan & package

3 Answers   IBM,


Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya

2 Answers   CSC,


how many bytes do SPPPP999 will store?

18 Answers  


describe 805 error

6 Answers   DELL,


What is the difference between Call and a Link?

0 Answers  


i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?

2 Answers  


what is MSGLEVEL?

1 Answers   IBM,


Categories