Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: current date code which would be used both in Batch & On
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: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Mon Feb 02, 2009 8:37 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Feb 02, 2009 9:15 pm    Post subject: Re: current date code which would be used both in Batch &
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us