MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Date and Time

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Thu Dec 27, 2007 3:47 am    Post subject: Date and Time Reply with quote

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
View user's profile Send private message Yahoo Messenger
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Dec 27, 2007 3:58 am    Post subject: Reply with quote

sarvan,
Check the below link for explanation on CURRENT-DATE.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr10/7.1.9?
If you wanna compare this time with extracted time, you can arrange your extracted time as per the fields in CURRENT-DATE.
Back to top
View user's profile Send private message Send e-mail
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Thu Dec 27, 2007 4:10 am    Post subject: Reply with quote

Thanks for your immediate response.
_________________
Thanks,

Sarvan.M
Back to top
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Dec 27, 2007 12:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Thu Dec 27, 2007 11:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Dec 28, 2007 12:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Fri Dec 28, 2007 2:50 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Dec 28, 2007 3:46 pm    Post subject: Reply with quote

You failed to mention anything about a VSAM file in your original post.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Fri Dec 28, 2007 4:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Sun Dec 30, 2007 10:16 pm    Post subject: Reply with quote

Thank you kolusu. I will check this and let u know.
_________________
Thanks,

Sarvan.M
Back to top
View user's profile Send private message Yahoo Messenger
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Wed Jan 02, 2008 12:13 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Wed Jan 02, 2008 2:27 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Wed Jan 02, 2008 2:30 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group