Re: COBOL/DB2 Date edit question
- From: LX-i <lxi0007@xxxxxxxxxxxx>
- Date: Sun, 12 Aug 2007 16:59:48 -0600
Graham Hobbs wrote:
My problem is to find the easiest/clearest way to edit these three
data types before update occurs. I suspect three ways are available:
1) my 'neat?' EXEC SQL.'s.
2) inline code like 'if month < 00 or >12 then error, etc'.
3) exec cics link 'editdate' with suitable commarea (and othe pgms for
TIME and TIMESTAMP) and test a return code. (your library routine)
I can vouch for option 2 being very, very efficient. We had a copybook that did date manipulation and validation. It was 3,000+ lines, and I was just sure that it could be made much, much more efficient.
Well, when we had some analysis done on our source code, the results came out with the paragraphs sorted from longest run time to shortest run time. For every program, the date/time routine's paragraphs filled the bottom of each list!
I had been working on a "convert" paragraph to convert time zones, using the database. After we got those results, I abandoned that. :) The one tweak I did make to it after that was to "cache" the time zone information (we tracked when offsets were changed, so we could convert times as they were configured at a given point in time). Caching those in working-storage allowed us to convert a lot of dates without plowing through the time change records every time. It really helped on one batch program in particular.
Just my $.02. (Also, I don't think "DATE()" by itself is a valid statement - though I've never used DB2. We used "SELECT [date-expression] INTO :host-variable FROM [table-with-one-row]".)
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \/ _ o ~ Live from Albuquerque, NM! ~
~ _ /\ | ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business E-mail ~ daniel @ "Business Website" below ~
~ Business Website ~ http://www.djs-consulting.com ~
~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~
~ Personal E-mail ~ "Personal Blog" as e-mail address ~
~ Personal Blog ~ http://daniel.summershome.org ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ !O M--
V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++
"Who is more irrational? A man who believes in a God he doesn't see,
or a man who's offended by a God he doesn't believe in?" - Brad Stine
.
- Follow-Ups:
- Re: COBOL/DB2 Date edit question
- From: Pete Dashwood
- Re: COBOL/DB2 Date edit question
- References:
- COBOL/DB2 Date edit question
- From: Graham Hobbs
- Re: COBOL/DB2 Date edit question
- From: Pete Dashwood
- Re: COBOL/DB2 Date edit question
- From: Graham Hobbs
- Re: COBOL/DB2 Date edit question
- From: Pete Dashwood
- Re: COBOL/DB2 Date edit question
- From: Michael Mattias
- Re: COBOL/DB2 Date edit question
- From: Graham Hobbs
- COBOL/DB2 Date edit question
- Prev by Date: Re: COBOL/DB2 Date edit question
- Next by Date: Re: OT: Baby Update
- Previous by thread: Re: COBOL/DB2 Date edit question
- Next by thread: Re: COBOL/DB2 Date edit question
- Index(es):