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

current date code which would be used both in Batch & On


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakeshnaredlla

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Mon Feb 02, 2009 8:20 pm
Reply with quote

Hi,

I have a program which will be called both in Batch and Online . This routine has current date in its Code. The code function Current- date is not working in this program. Please suggest me any code which would run both in Batch and Online.

Thank you......
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 02, 2009 8:37 pm
Reply with quote

From the COBOL Programming Guide:
Quote:
3.1.1.2 Retrieving the system date and time


You cannot use a format-1 ACCEPT statement in a CICS program.

You can use these format-2 ACCEPT statements in the CICS environment to get the system date:

* ACCEPT identifier-2 FROM DATE

* ACCEPT identifier-2 FROM DATE YYYYMMDD

* ACCEPT identifier-2 FROM DAY

* ACCEPT identifier-2 FROM DAY YYYYDDD

* ACCEPT identifier-2 FROM DAY-OF-WEEK

You can use this format-2 ACCEPT statement in the CICS environment to get the system time:

* ACCEPT identifier-2 FROM TIME

The recommended way to retrieve system date and time information is to use the ACCEPT statement, because it works in all environments (CICS and non-CICS).
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Feb 02, 2009 9:15 pm
Reply with quote

Your COBOL version/release must be (at a minimum), COBOL/370, which is the version/release COBOL FUNCTION's were introduced.

Otherwise, review the Callable Service routine "CEELOCT" in the appropriate Language Environment manual, which can be used in COBOL II as well as its predecessor, OS/VS COBOL.

FWIW, LE is available in COBOL/370 and greater and is an integral part of the compiler.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top