how can we get current dat and time thru cobol pgm
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / aaki
You can fetch current date from SysIBM.Sysdummy1 table in a
working storage variable
Is This Answer Correct ? | 3 Yes | 1 No |
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.
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?
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?
What is COMP-1? COMP-2?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it
State the various causes of s0c1, s0c5 and s0c7.
What will happen if we try to create GDG (+2) generaton instead of (+1) generation?
can we use the two 01 level in file discription ?
u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?
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
What is "Call by content" and "call by reference"?