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

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,


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

0 Answers  


WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR1. DISPLAY 'VAR1 =' VAR1. GOBACK. 10.2115 is stored as .10211499999999996E 02 in OS VS Cobol 10.2115 is stored as .10211500000000000E 02 in ecobol. Any reason why?

3 Answers   TCS,


What is COMP-1? COMP-2?

4 Answers   CitiGroup,


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

0 Answers  






how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it

2 Answers  


State the various causes of s0c1, s0c5 and s0c7.

0 Answers  


What will happen if we try to create GDG (+2) generaton instead of (+1) generation?

1 Answers  


can we use the two 01 level in file discription ?

6 Answers  


u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?

2 Answers   IBM,


The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


What is "Call by content" and "call by reference"?

4 Answers   ADP, Syntel,


Categories