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
 
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: 8280
Location: Dubuque, Iowa, 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: 2504
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 Getting GG return code abdulrafi IMS DB/DC 2 Tue Apr 10, 2018 12:31 pm
No new posts batch cobol/db2 paragraph fall thru a... alois eisshofer COBOL Programming 5 Wed Mar 14, 2018 12:21 am
No new posts IMS error U4038 while executing my PL... abdulrafi IMS DB/DC 2 Thu Feb 08, 2018 1:05 pm
No new posts Conditional setting of return-code af... sanvan COBOL Programming 9 Wed Jan 31, 2018 11:05 pm
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am

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