Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10
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

Senior Member


Joined: 14 Mar 2007
Posts: 10626
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: 1789
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: 2230
Location: Hampshire, 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 Convert string to packed format ajaydwivedi4u COBOL Programming 6 Sat Sep 21, 2019 5:01 pm
No new posts Convert from 1/1/2019 to 01/01/2019 sudhakarraju DFSORT/ICETOOL 3 Fri Sep 20, 2019 1:16 am
No new posts Convert Numeric to Packed decimal and... anand1204 DFSORT/ICETOOL 5 Thu Aug 08, 2019 3:53 am
No new posts Converting a copybook value into Json... srikant314 COBOL Programming 1 Mon Jun 03, 2019 11:17 am
No new posts Alphanumeric to Packed Decimal Conver... Vijay_Sirisha COBOL Programming 2 Mon May 27, 2019 2:52 am

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