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
 
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: 37
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: 37
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
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm

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