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
 

 

JCL to convert float decimal into readable format

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
polymathtarun

New User


Joined: 01 May 2016
Posts: 9
Location: India

PostPosted: Sun May 15, 2016 9:57 pm    Post subject: JCL to convert float decimal into readable format
Reply with quote

I have a problem statement. I am trying to dump decimal float fields (field not defined in COBOL but in C) from M/F to some other PS file but they are displaying as junk characters. The way these fields are stored in prduction VSAM files, they can be converted to date timestamp using a formula = (((A1/60)/60)/24)+DATE(1970,1,1)+(-5/24)

Code:
START_DATETIME                                       END_DATETIME           
   8/DFL                                                           8/DFL                 
 (116-123)                                                    (124-131)             
18--------------------- 19---------------------
********************** TOP OF DATA **********************
  0.000000000000000E+00                             0.000000000000000E+00
  1.459083508948937E+09                             1.459083508960886E+09
  1.459083509076715E+09                             1.459083509571374E+09
  1.459083608999276E+09                             1.459083609005132E+09
  1.459083609076200E+09                             1.459083609288005E+09
  1.459083767495601E+09                             1.459083767497423E+09
  1.459083961505914E+09                             1.459083961507754E+09
  1.459083972490339E+09                             1.459083972996430E+09
  1.459083973002954E+09                             1.459083973047763E+09
  1.459084043818478E+09                             1.459084043855324E+09


Conversion sample below-

Code:
Start_Datetime                       Start_Datetime  after using above formula       
1.458237600498944E+09                  3/17/2016/13:00:00.499
1.458237600521761E+09                  3/17/2016/13:00:00.522


Please let me know if anyone has ever written JCL for this conversion.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Sun May 15, 2016 10:51 pm    Post subject: Reply to: JCL to convert float decimal into readable format
Reply with quote

no...
because nobody with a bit of good judgement would use a float to represent a date!
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Mon May 16, 2016 5:50 am    Post subject:
Reply with quote

This was a really bad idea, not only because, as Dr. Sorichetti says, storing a date as a floating-point is itself a bad idea due to rounding issues, but because different platforms may store floating-point numbers differently.

I don't think that *Sort (and of course you're talking about *Sort, not JCL) can do this kind of calculation; you'll probably have to write a programette.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Mon May 16, 2016 7:47 pm    Post subject:
Reply with quote

No - because JCL does not mess with data. It tells the system that you want to execute a program and what resources that program needs.

You shuld also present your data using the code tags. I will do that for you this time - and lock the topic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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