how can we get current dat and time thru cobol pgm

Answers were Sorted based on User's Feedback



how can we get current dat and time thru cobol pgm..

Answer / vinodquestion

HI friend,

Move function CURRENT-DATE to dt.

Here dt is a working storage variable.

If you want exactly date and time do this

Instead of CURRENT-DATE in above statement write this.

CURRENT-DATE(1:16)

That is using referential modification.

Is This Answer Correct ?    10 Yes 0 No

how can we get current dat and time thru cobol pgm..

Answer / gummadi srinivas

USING REFERENCE MODIFICATION WE GET DATE

1) current date
move function current-date (1:8) to ws-today
here ws-today is w.s.s variable


2) current time
move function current-date (9:6) to ws-time
here ws-time is the w.s.s variable

Is This Answer Correct ?    4 Yes 0 No

how can we get current dat and time thru cobol pgm..

Answer / aaki

You can fetch current date from SysIBM.Sysdummy1 table in a
working storage variable

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More COBOL Interview Questions

2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

0 Answers  


which one is better among static call and dynamic call?

3 Answers  


What do you understand by passing by reference and passing by content?

1 Answers  


how do you reference the variable unblock file formats from cobol programs

0 Answers  


What are different file OPEN modes available in COBOL?

4 Answers   Sun Life,






Scenario: I have 3 Input Files.Read the first i/p file and depending on certain business logic, I want to read wither i/p file-2 or i/p file-3.Now, depending on certain business logic applied to the record read from either file-2 or file-3, I decide to write them to either output file-2 or output file-2. Question: How many job steps are necessary to implement a solution for the above.

2 Answers   TCS,


What is the difference between CONTINUE & NEXT SENTENCE ?

2 Answers  


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  


Syntax for JCLLIB & JOBLIB???

1 Answers  


What is the different between index and subscript?

3 Answers  


I have a file it contain 10 records.i got abend at 8th record because of soc7.how do you know that perticular record got abend?

3 Answers   IBM,


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.

10 Answers   IBM,


Categories