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
 

 

Date funtiopn for CICS and batch module

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
chavansu

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Wed May 13, 2009 6:12 pm    Post subject: Date funtiopn for CICS and batch module
Reply with quote

Hi,

I have a procedurel copybook which is called from batch program and CICS program too. Which is the DATE function I can use in copybook to get the last day of the previous month?

I know that OGDATES is used only in CICS.

Please help.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 13, 2009 6:23 pm    Post subject:
Reply with quote

why don't you write a cobol module that can be CALLed from both batch an cics?

most shops have 1 module that deals with dates. If yours does not,
suggest you write one.

need a copybook that would define Function, input fields and output fields.
either use LE (language environment CALLs) or do a simple ACCEPT DATE INTO.

that way every module in your application would have one source for determining dates, as well as one source for the current date which then can be manipulated.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7993
Location: Bellevue, IA

PostPosted: Wed May 13, 2009 6:23 pm    Post subject:
Reply with quote

I don't know what OGDATES is so I can't help you there. I don't believe it is a standard IBM facility or function.

In batch, you can use functions INTEGER-OF-DATE and DATE-OF-INTEGER. Convert the date to an integer value, subtract the day of the month from the integer, and convert back into a date.
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: Wed May 13, 2009 8:00 pm    Post subject: Reply to: Date funtiopn for CICS and batch module
Reply with quote

I'm with Dick and would use the LE Callable Date routines rather than the COBOL FUNCTIONS.

Remember, FUNCTIONS we not introduced until COBOL/370, the successor to VS/COBOL II.

Whereas, LE Callable Date routines can be used in any version of COBOL, including OS/VS COBOL and VS/COBOL II, plus the Callable routines have the ability to return a return-code. If a FUNCTION receives a bad-date, it will crash and burn.

What version/release of COBOL are you using?

Regards,
Back to top
View user's profile Send private message
chavansu

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Wed May 13, 2009 9:52 pm    Post subject:
Reply with quote

We are using COBOL 4.0 version with z/OS 01.09.00
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: Wed May 13, 2009 10:26 pm    Post subject: Reply to: Date funtiopn for CICS and batch module
Reply with quote

Is this VS/COBOL II version V4R0? If it is, then FUNCTIONS were not part of this version/release.

Other than an in-house developed or 3rd-pary purchased date sub-system, LE Callable Service routines might be your only choice.

COBOL II has been out of support for almost 10 years.

There is an Enterprise COBOL, V4R1. Is this your level?

I'm almost certain that COBOL II can run with z/OS 1.9, but your shop really should upgrade to a supported level.

Regards,
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 Batch job tunning sgandhla Testing & Performance analysis 0 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm


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