View previous topic :: View next topic |
Author |
Message |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Thu Dec 27, 2007 3:47 am Post subject: Date and Time |
|
|
I just extracted the date and time from Mainframe program it shows the following data, 20061228003376316554480. Here first 4 characters denotes the year, next 2 month, next 2 day. Remaining 15 char denotes the time. I tried to display the system time to know about its structure but the system output shows in the following format as 11233489 where every 2 chars represent Hrs,Mts,Sec,MilliSec respetively. I am confused about this two different representation.
I want to compare the system time with this extracted time from mainframe but i am unable to do it, as both are in different format. Please advice me. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Thu Dec 27, 2007 4:10 am Post subject: |
|
|
Thanks for your immediate response. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Dec 27, 2007 12:08 pm Post subject: |
|
|
That format doesn't match the format that was listed in the current date documentation that vkphani referenced. How did you get that date? What language are you using? _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Thu Dec 27, 2007 11:42 pm Post subject: |
|
|
I am using COBOL. I displayed only the system time,11233489 is the time and not the full date and time format. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Dec 28, 2007 12:05 am Post subject: |
|
|
I meant the 20061228003376316554480 format.
Where did that come from? _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Fri Dec 28, 2007 2:50 am Post subject: |
|
|
I took that from VSAM files. 2006.12.28.003376316554480 every dot(.) represents end of field. The date and time are given in CICS region. I found that the time is declared as s9(15), so the " 003376316554480" represents absolute time in CICS region. Can anyone explain me about this _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Dec 28, 2007 3:46 pm Post subject: |
|
|
You failed to mention anything about a VSAM file in your original post. _________________ ....Terry |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Dec 28, 2007 4:03 pm Post subject: |
|
|
sarvan wrote: | I took that from VSAM files. 2006.12.28.003376316554480 every dot(.) represents end of field. The date and time are given in CICS region. I found that the time is declared as s9(15), so the " 003376316554480" represents absolute time in CICS region. Can anyone explain me about this |
sarvan,
ABSTIME in CICS specifies the data value for the time, in packed decimal(s9(15) comp-3), since 00:00 hours on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second) that is to be converted to an alternative format. so the " 003376316554480" is indeed the time in milliseconds since 1st january 1990. if you need to convert it to a date form then use the function FORMATTIME in cics
Code: |
EXEC CICS ASKTIME ABSTIME(utime)
EXEC CICS FORMATTIME ABSTIME(utime)
DATESEP('-') DDMMYYYY(date)
TIME(time) TIMESEP
|
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Sun Dec 30, 2007 10:16 pm Post subject: |
|
|
Thank you kolusu. I will check this and let u know. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Wed Jan 02, 2008 12:13 am Post subject: |
|
|
Is there any way to convert the system date and time in to absolute time. I need to do this in Batch program. Kolusu has given in CICS language but i am creating a batch program. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Wed Jan 02, 2008 2:27 am Post subject: |
|
|
I just want to refine my queries.
DATE-YR PIC X(04).
DATE-MO PIC X(02).
DATE-DY PIC X(02).
ABS-TIME PIC S9(15).
this is my layout for the VSAM file. I have generated a flatfile for the same.
The sample data for this is,
2003.12.08. 003279895320330
I am writing a COBOL program where i want to compare this data with the system date and time in COBOL. For this i have to convert the system date and time (2008010107090136) in to this absolute time. _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Wed Jan 02, 2008 2:30 am Post subject: |
|
|
sarvan wrote: | I just want to refine my queries.
DATE-YR PIC X(04).
DATE-MO PIC X(02).
DATE-DY PIC X(02).
ABS-TIME PIC S9(15).
this is my layout for the VSAM file. I have generated a flatfile for the same.
The sample data for this is,
2003.12.08. 003279895320330
I am writing a COBOL program where i want to compare this data with the system date and time in COBOL. For this i have to convert the system date and time (2008010107090136) in to this absolute time. Is there any built in function to perform this. |
_________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
|
|