Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

pass numeric value of length 14 to timestamp value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
purushottam

New User


Joined: 26 Feb 2007
Posts: 34
Location: pune

PostPosted: Fri Jan 15, 2016 3:20 pm    Post subject: pass numeric value of length 14 to timestamp value
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: 34
Location: pune

PostPosted: Fri Jan 15, 2016 4:30 pm    Post subject: Reply to: pass numeric value of length 14 to timestamp value
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    Post subject: Reply to: pass numeric value of length 14 to timestamp value
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    Post subject:
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    Post subject: Reply to: pass numeric value of length 14 to timestamp value
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us