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
 
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: 6970
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: 8201
Location: Dubuque, Iowa, USA

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: 2504
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: 2504
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 Is CICS BMS logic on z/OS different ... Andi1982 CICS 2 Fri Dec 01, 2017 1:56 pm
No new posts CA Intertest Batch 555shanth CA Products 0 Tue Nov 28, 2017 11:10 am
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm

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