IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

pass numeric value of length 14 to timestamp value


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
purushottam

New User


Joined: 26 Feb 2007
Posts: 37
Location: pune

PostPosted: Fri Jan 15, 2016 3:20 pm
Reply with quote

how to pass value of numeric variable of length 14 to timestamp variable

eg: - I want to move this 16011414343494 value to timestamp variable
Back to top
View user's profile Send private message
purushottam

New User


Joined: 26 Feb 2007
Posts: 37
Location: pune

PostPosted: Fri Jan 15, 2016 4:30 pm
Reply with quote

from timestamp variable of TYPE T


16 : Year
01 : Month
14 : Day
14 : Hour
34 : Minutes
34 : Seconds
94 : milliseconds
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Fri Jan 15, 2016 9:39 pm
Reply with quote

You can set a time variable using a time literal, but it's accurate only to the second.
Code:
ASSIGN #T = E'2016-01-14 14:34:34'

ps The term TIMESTAMP is reserved for the system's STORCLOCK value (format B8).
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Jan 15, 2016 10:48 pm
Reply with quote

timestamp is also a DB2 term and in the format of
2016-01-15-07.37.08.724517
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Sat Jan 16, 2016 1:54 am
Reply with quote

Purushottam,

If your value is in a variable, then you can use MOVE EDITED for the conversion of alpha to T format.
Code:
DEFINE DATA LOCAL
1 #A (A14) INIT <'16011414343494'>
1 #T (T)
END-DEFINE
MOVE EDITED #A TO #T (EM=YYMMDDHHIISS)
DISPLAY #A #T (EM=YYYY/MM/DD^HH:II:SS)
END

Code:
Page     1                                                   01/15/16  12:21:14
 
      #A               #T
-------------- -------------------
 
16011414343494 2016/01/14 14:34:34
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top