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
 

 

Eazytrive program for converting field into fractions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Eazytrive program for converting field into fractions
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: 3158
Location: Tucson AZ

PostPosted: Thu Feb 14, 2008 4:00 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Feb 14, 2008 5:26 am    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Feb 14, 2008 6:48 am    Post subject:
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

Site Director


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

PostPosted: Thu Feb 14, 2008 8:25 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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