IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date funtiopn for CICS and batch module


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed May 13, 2009 6:23 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed May 13, 2009 8:00 pm
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed May 13, 2009 10:26 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top