View previous topic :: View next topic
|
Author |
Message |
chavansu
New User
Joined: 20 Nov 2008 Posts: 14 Location: California USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
chavansu
New User
Joined: 20 Nov 2008 Posts: 14 Location: California USA
|
|
|
|
We are using COBOL 4.0 version with z/OS 01.09.00 |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
|