Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
jamshirqureshi

New User

Joined: 13 Aug 2006
Posts: 20
Location: mumbai

 Posted: Thu Feb 14, 2008 3:34 am    Post subject: Eazytrive program for converting field into fractions Hi All, If anybodys know to convert any field into fraction in eazytrieve. Suppose I am a reading a file and I have a value like price and before writing to the output file. I want to convert this price value into fraction. If anybody knows how to convert or sample code please let me know Thanks, jamz

William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

 Posted: Thu Feb 14, 2008 4:00 am    Post subject: Could you expand on the scope of fractions you are looking for? Is .33 >> 1/3 or 33/100? Is .25 >> 1/4 or 25/100?
jamshirqureshi

New User

Joined: 13 Aug 2006
Posts: 20
Location: mumbai

 Posted: Thu Feb 14, 2008 4:15 am    Post subject: I am looking for .33 these kind of fraction. how to declare this in eazytrive and how to convert this? suppose i have price value in 1 and i want to convert as .125 then i have to write to the output. Thanks, Jamz
Douglas Wilder

Active User

Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

 Posted: Thu Feb 14, 2008 4:52 am    Post subject: That is decimal not fraction. How are the fields defined? If the field is defined as "FIELD1 5 N 2" and it contains 12345 it will be reported as 123.45
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Thu Feb 14, 2008 5:26 am    Post subject:

Hello,

 Quote: suppose i have price value in 1 and i want to convert as .125 then i have to write to the output.
What calculation will you use to cause the result of .125?

Using only the price, i know of no way to convert it to some % or some decimal value.

If ytou post examples of a few values and the result you want from using those values, we should be able to offer better suggestions.
Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

Posted: Thu Feb 14, 2008 6:32 am    Post subject:

dick scherrer wrote:
Hello,

 Quote: suppose i have price value in 1 and i want to convert as .125 then i have to write to the output.
What calculation will you use to cause the result of .125?

Using only the price, i know of no way to convert it to some % or some decimal value.

If ytou post examples of a few values and the result you want from using those values, we should be able to offer better suggestions.

He is trying to convert decimal to a fraction. .125 = 1/8
This would be simple if .125 = 125/1000 was acceptable but reducing a fraction would be more difficult. If 3 decimal places is most then it could be done with a table.
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Thu Feb 14, 2008 6:48 am    Post subject:

 jamshirqureshi wrote: I am looking for .33 these kind of fraction. how to declare this in eazytrive and how to convert this?

As he said.
 Douglas Wilder wrote: If the field is defined as "FIELD1 5 N 2" and it contains 12345 it will be reported as 123.45
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Thu Feb 14, 2008 8:25 am    Post subject: Well, So far i've seen multiple thoughts that make sense to me. They are not "the same" but any could be the answer jamz is looking for. For my \$.02, i'd still like to see some sample "input" and what the desired "output" would be. . .
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us