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
 
Want to get absolute time in X(15) form.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Gaurav Bhayawala

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Mon Nov 17, 2008 7:06 pm    Post subject: Want to get absolute time in X(15) form.
Reply with quote

I have one time field in HHMMSSXX form & one Date field in Juian..
I want to get absolute time in X(15) form.
How can I get it...?

Here my confusion is, I don't know in which form TIMES & DATES should be there in absolute time field - X(15).
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Mon Nov 17, 2008 7:09 pm    Post subject:
Reply with quote

I've never heard of absolute time except in reference to CICS programs. As far as I know, there's no way in batch COBOL to get this field.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10310
Location: italy

PostPosted: Mon Nov 17, 2008 7:13 pm    Post subject: Reply to: [b]ABSOLUTE TIME in Mainframe[/b]
Reply with quote

all depends on the absolute time definition...

as far as cics is concerned her is the definition

Quote:
specifies the data area for the time, in packed decimal, since 00:00 on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second).


with the definitions

Code:

COBOL:  PIC S9(15) COMP-3   
C       char data_area[8];
PL/I:   FIXED DEC(15)   
ASM:    PL8   

in other word 8 bytes packed
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10310
Location: italy

PostPosted: Mon Nov 17, 2008 7:21 pm    Post subject: Reply to: ABSOLUTE TIME
Reply with quote

follow on to my previous post...
I would go with the LE convention

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea3180/2.2.5.65?ACTION=MATCHES&REQUEST=time&TYPE=FUZZY&SHELF=CEE2BK80.bks&DT=20070428023816&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

ceesecs and ceedatm make the conversion quite straigthforward
Back to top
View user's profile Send private message
Gaurav Bhayawala

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Mon Nov 17, 2008 7:24 pm    Post subject: Reply to: ABSOLUTE TIME
Reply with quote

enrico-sorichetti,
I agree, it stores in Packed decimal (8 bytes).

But here as per my question if my date = 1st Jan 2008 (In Julian - 0012008)
& Time = 01:40:30:80 (in HH:MM:SS:XX)

Now I want this in Absolute form FINAL DATE in S9(15) COMP-3.
How it will be manage in this field
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10310
Location: italy

PostPosted: Mon Nov 17, 2008 7:33 pm    Post subject: Reply to: ABSOLUTE TIME
Reply with quote

I gave You the link to the LE manual
a bit of ingenuity and a couple of reference modification moves should do it
Back to top
View user's profile Send private message
Gaurav Bhayawala

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Mon Nov 17, 2008 7:44 pm    Post subject: Reply to: ABSOLUTE TIME
Reply with quote

Thanks enrico-sorichetti,

I have asked the second question before you sent me answer with attached link...So before posting it u may have sent the link...
So that has created confusion betweeen us...

Anyway thanks for your valuable help...

Regards,
Gaurav
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: Mon Nov 17, 2008 10:01 pm    Post subject: Re: ABSOLUTE TIME
Reply with quote

First, you need to get the number of days between the Julian-Date and 01 January 1900.

This can be accomplished by subtracting FUNCTION INTEGER-OF-DAY(1900001) from FUNCTION INTEGER-OF-DAY(JULIAN-DATE), multiply this difference by 86400000 and
store it in a PIC 9(15) field, which is redefined as PIC X(15).

You must ensure that your JULIAN-DATE has a valid century before the above calculation, with a format of CCYYDDD.

To validate the JULIAN-DATE, you can call LE Callable Service routine "CEEDAYS" beforehand.

Date FUNCTION's in COBOL assume you are passing a valid date and will blow-up if this is not true.

Then, multiply the HH by 3600000, multiply the MM by 60000, multiply the SS by 1000 and multiply the XX (assuming this is TH) by 10 and add all of these calculated values to
the above PIC 9(15) field. The result will have a low-order display-numeric zero, representing the millisecond-portion.

You're done!

Code:

           COMPUTE WS-ABSTIME          = (FUNCTION INTEGER-OF-DAY       
                                         (WS-JULIAN-DATE)        -
                                          FUNCTION INTEGER-OF-DAY       
                                         (1900001)).                     
           COMPUTE WS-ABSTIME          = (WS-ABSTIME * 86400000) +
                                         (WS-TIME-HH * 3600000)  +
                                         (WS-TIME-MM * 60000)    +
                                         (WS-TIME-SS * 1000)     +
                                         (WS-TIME-TH * 10).             

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
Gaurav Bhayawala

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Tue Nov 18, 2008 1:24 pm    Post subject: Reply to: Want to get absolute time in X(15) form.
Reply with quote

Bill O'Boyle,

Thank you very much...
This is the answer which I was looking for...
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 Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 0 Fri Sep 22, 2017 6:00 pm
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts Application not run by time HH:MM tri... jzhardy IBM Tools 1 Sun Apr 09, 2017 3:22 pm

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