> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Joel Ivey
> Sent: Wednesday, June 01, 2005 10:21 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: synching cics abstime with le batch time
> 
> 
> A programmer has a cics vsam file that includes a 
> non-formatted timestamp in
> the key.  This is the number of ms since 1/1/1900.
> 
> There is a need to be able to create records in batch with 
> the same kind of
> key, and to later merge that batch vsam file with the cics vsam file.
> 
> We need a routine to calculate a non-formatted timestamp in 
> batch using the
> same date reference point as cics.  However, in batch the the 
> date ref seems
> to be 1/1/1601.   Has anyone dealt with this before and maybe 
> have a snippit
> of code we could grab?
> 
> Thanks,
> Joel

The batch date that you are speaking of is the COBOL ANSI date, not the
LE date. What I'd do is simply use INTEGER-OF-DATE function to get the
ANSI date of "1/1/1900". For example:

01 INPUT-DATE-YYYYMMDD PIC 9(8).
01 INPUT-TIME.
   05 INPUT-TIME-HH PIC 99.
   05 INPUT-TIME-MM PIC 99.
   05 INPUT-TIME-SS PIC 99.
   05 INPUT-TIME-TH PIC 99.
01 INPUT-TIME-MS PIC S9(8) BINARY.

ACCEPT INPUT-DATE-YYYYMMDD FROM DATE YYYYMMDD
ACCEPT INPUT-TIME FROM TIME
COMPUTE INPUT-TIME-MS=
 
10*(INPUT-TIME-TH+100*(INPUT-TIME-SS+60*(INPUT-TIME-MM+60*INPUT-TIME-HH)
))
END-COMPUTE
COMPUTE INPUT-DATE = FUNCTION INTEGER-OF-DATE(INPUT-DATE-YYYYMMDD)
END-COMPUTE
COMPUTE VSAM-KEY=INPUT-TIME-MS+
    24*60*60*1000*(INPUT-DATE - FUNCTION INTEGER-OF-DATE(19000101))
END-COMPUTE

That is 24 hours in a day times 60 minutes in an hour times 60 seconds
in a minute type 1000 milliseconds in a second times the number of days
since 1900-01-01 (19000101). If you need down to the millisecond from
the current date/time.

Note that the above is not test. It may have syntax errors. Corrections
are left as an exercise for the viewers.

--
John McKown
Senior Systems Programmer
UICI Insurance Center
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its'
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to