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

Is there any way of keeping the decimal part in a DIV?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
giligili

New User


Joined: 07 Jun 2007
Posts: 2
Location: Spain

PostPosted: Mon Jun 14, 2010 9:21 pm
Reply with quote

I need to make a division, between two PD, length 8.

And I would like to obtain a result with 7 decimal digits.

Is there any way to do this?

Thanks for the help.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jun 14, 2010 9:23 pm
Reply with quote

giligili,

It would help if you posted a sample of input along with desired results. Also post the RECFM and LRECL of the input and output datasets.
Back to top
View user's profile Send private message
giligili

New User


Joined: 07 Jun 2007
Posts: 2
Location: Spain

PostPosted: Wed Jun 16, 2010 6:26 pm
Reply with quote

I've solved my problem.

My problem was that I needed two divide two numbers of a record, and keep up to 7 decimal digits. Because I needed a result with this PIC= 9(5)V9(7)

example:
Code:

200037639812345 123452234567890


And if I just use the DIV operator:

Code:

  OUTREC BUILD=((1,15,ZD,DIV,17,15,ZD),TO=ZD,LENGTH=12)


I obtained this result:
Code:

000000000001


In the end, I've solved this multiplying one number by 10000000 before dividing.

Code:

  OUTREC BUILD=(((1,15,ZD,MUL,+10000000),DIV,17,15,ZD),TO=ZD,LENGTH=12)


and I'm obtaining the result that I need:

Code:

000016206739


Thanks for the help.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jun 16, 2010 10:45 pm
Reply with quote

Yes, that's what you need to do.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts String has hex character need to conv... COBOL Programming 3
No new posts How to display the leading zeros of a... DB2 7
Search our Forums:

Back to Top