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

Eazytrive program for converting field into fractions


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Thu Feb 14, 2008 3:34 am
Reply with quote

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
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Feb 14, 2008 4:00 am
Reply with quote

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?
Back to top
View user's profile Send private message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Thu Feb 14, 2008 4:15 am
Reply with quote

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
Back to top
View user's profile Send private message
Douglas Wilder

Active User


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

PostPosted: Thu Feb 14, 2008 4:52 am
Reply with quote

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
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 14, 2008 5:26 am
Reply with quote

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.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Thu Feb 14, 2008 6:32 am
Reply with quote

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.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Feb 14, 2008 6:48 am
Reply with quote

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
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 14, 2008 8:25 am
Reply with quote

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. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Using API Gateway from CICS program CICS 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top