IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to obtain the current date in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
padmalaya89

New User


Joined: 15 Jul 2005
Posts: 8
Location: krishnagiri

PostPosted: Mon Jul 31, 2006 10:16 am
Reply with quote

how can you obtain the current date in cobol thanks oin advance
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Jul 31, 2006 10:50 am
Reply with quote

Hi,

Accept identifier from date
Back to top
View user's profile Send private message
SBMF390

New User


Joined: 27 Jul 2006
Posts: 9

PostPosted: Wed Aug 02, 2006 5:35 pm
Reply with quote

You can get the current date by

MOVE FUNCTION CURRENT-DATE(1:8) TO CURR-DATE.
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Wed Aug 02, 2006 7:22 pm
Reply with quote

Hi I would like to add one more point. I tried with so many options to display 4 digit year in my batch job. But I couldn't get. For that finally I got with the following code. What might be the reason we couldn't get without using the following logic.

WORKING-STORAGE SECTION.
01 CE-SYSTEM-DATE PIC X(08) VALUE SPACES.
01 CE-CURR-DATE PIC X(10) VALUE SPACES.

PROCEDURE DIVISION.
CALL 'IGZEDT4' USING BY REFERENCE CE-SYSTEM-DATE.
STRING CE-SYSTEM-DATE(5:2) '-'
CE-SYSTEM-DATE(7:2) '-'
CE-SYSTEM-DATE(1:4)
DELIMITED BY SIZE INTO CE-CURR-DATE.

DISPLAY 'CURRENT DATE IS:' CE-CURR-DATE.

Thanks!
Rathna.
Back to top
View user's profile Send private message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Thu Aug 03, 2006 2:36 pm
Reply with quote

i think it will be easy if u code like this


EXEC SQL
SET :WS-CUR-TS = CURRENT DATE
END-EXEC.


and then the manipulations u require
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Thu Aug 03, 2006 6:29 pm
Reply with quote

We are not using SQL. I want without using SQL.

Thanks!
Rathna.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Aug 04, 2006 12:42 am
Reply with quote

use the misdate subroutine
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Tue Aug 08, 2006 1:51 pm
Reply with quote

Hi VIjayamadhuri, can you please let me know WHAT is MISDATE subroutine? B'cos I nere heard this word. Please elaborate for us.

Thanks!
Rathna.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top