Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to obtain the current date in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to obtain the current date in cobol
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: 1187
Location: Bangalore,India

PostPosted: Mon Jul 31, 2006 10:50 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: How to obtain the current date in cobol
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    Post subject: Re: How to obtain the current date in cobol
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    Post subject: hello
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    Post subject: Re: hello
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us