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

JCL to convert float decimal into readable format


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

New User


Joined: 01 May 2016
Posts: 10
Location: India

PostPosted: Sun May 15, 2016 9:57 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sun May 15, 2016 10:51 pm
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: 1788
Location: Bloomington, IL

PostPosted: Mon May 16, 2016 5:50 am
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: 2455
Location: Hampshire, UK

PostPosted: Mon May 16, 2016 7:47 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top