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: 8165
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: 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 Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am

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