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
 

 

Convert EIBTIME into HH.MM.SS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Thu Oct 18, 2012 4:33 pm    Post subject: Convert EIBTIME into HH.MM.SS
Reply with quote

Hi,

My file(RECFM=VB) is created by a CICS program which moves EIBDATE(S9(7) COMP-3 - 0CYYDDD+) and EIBTIME(S9(7) COMP-3 - 0HHMMSS+) values into a field. I used the below sort to convert them into the desired format. I am convinced about the date conversion, but can someone please explain if the time shown is correct? The actual requirement is to create a DB2 timestamp out of those 2 fields.

Code:
OUTREC BUILD=(1,4,18,3,Y2U,TOGREG=Y4T(-),C'-',21,4,PD,TO=ZD,LENGTH=7)


The output is
Code:

2012-10-17-0021120
2012-10-17-0021120
2012-10-17-0029560
2012-10-17-0029560
2012-10-17-0051360
2012-10-17-0051360
2012-10-17-0056060
2012-10-17-0056060
2012-10-17-0100490
2012-10-17-0100490


By the hex values of those 10 records are as below.

Code:

21210210
029F012F   
21210210
029F012F
21210250
029F096F       
21210250
029F096F
21210530
029F016F
21210530
029F016F
21210500
029F066F
21210500
029F066F
21210040
029F109F
21210040
029F109F


Based on my analysis it seems the results produced by DFSORT are correct? Is the data incorrect in the file or are there any problems in the timeconversion? Can someone please suggest any better way if exists to convert the DATE,TIME fields into DB2 timestamp format? YYYY-MM-DD-HH.MM.SS.000000
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Oct 18, 2012 7:21 pm    Post subject:
Reply with quote

Quote:
YYYY-MM-DD-HH.MM.SS.000000


if you want the above to be your 'timestamp' format, great.
depends on the ultimate purpose of your generated 'timestamp'.

most of the time yyyy-mm-dd-hh:mm:ss:mmmmmm is the pattern
but that can be overridden with 'timestamp format' parm in the timestamp scalar function in db2 10
(probably earlier, but i am to lazy to look
since I have always used yyyy-mm-dd-hh:mm:ss:mmmmmm
as my pattern and never have had any trouble using that as a host variable).

i am ignoring the 'hex values' that you have provided.
they make little or no sense.

so, why don't you tell us for what use you intend your 'generated timestamp'
and we may be able to help.

2012-10-17-0021120 is 2012-10-17-0hhmmss
so what you are generating now is useless.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Thu Oct 18, 2012 7:32 pm    Post subject:
Reply with quote

Hi dbzTHEdinosauer,

I thought the same way as you did about the time format that 0021120 is 0hhmmss. But it was actually hhmmss0.

So the times and hex values are clear. The time here is 00:21:12 in the way you want to see.

I got the problem resolved. Thanks for the information provided.


Regards
Amar
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 18, 2012 10:04 pm    Post subject: Reply to: Convert EIBTIME into HH.MM.SS
Reply with quote

V S Amarendra Reddy,

You need to use PD0 format which ignores the first digit and the sign. Use the following control cards to create a 26 byte timestamp field.


Code:

OUTREC BUILD=(1,4,18,3,Y2U,TOGREG=Y4T(-),C'-',
              21,4,PD0,EDIT=(TT:TT:TT),C'.000000')
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Fri Oct 19, 2012 3:47 pm    Post subject:
Reply with quote

Thank you Skolusu
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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