× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm not sure what you would miss about RPG's SUBDUR. Take a look at
SUBTRACT-DURATION. Unless I'm blind to something, anything you can do in
RPG with SUBDIR, you can do with COBOL's SUBTRACT-DURATION. As Chuck
(CRPENCE) noted in his reply, there are several date, time, and datetime
intrinsic functions available.

As he also noted, be sure to specify CVTOPT(*DATETIME *DATE *TIME
*TIMESTAMP). You may also be interested in specifying
CVTOPT(*CVTTODATE)--which can convert a field defined in DDS as PIC 9(6)
DATFMT(YMD) as a true date field (i.e., FORMAT DATE '%y%m%d').

if you have something specific you're trying to accomplish, examples would
be easier to provide. There are probably millions of things you can do
with dates and times. I haven't found any of them especially difficult.

cobol400-l-bounces@xxxxxxxxxxxx wrote on 11/02/2013 01:00:07 PM:
----- Message from Paul Raulerson <paul.raulerson@xxxxxxx> on Sat,
02 Nov 2013 11:02:42 -0500 -----

To:

cobol400-l@xxxxxxxxxxxx

Subject:

[COBOL400-L] Date and TimeStamp Samples?


Does anyone have some samples or a reply bail tutorial on using
Dates and TimeStamps in COBOL? What is the best way to use them? In
particular, when some of these records are updated, there are date
fields in the record itself, and a LAST_CHG_TS field .

I have gotten spoiled with RPG, especially the duration SUBDUR
opcode. I am sure I have done this before in ILE COBOL, but
honestly, I have forgotten how.

Anyone willing to share examples of or a basic tutorial for ILE
COBOL using date and timestamp fields?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.