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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Is there any way of keeping the decimal part in a DIV?
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jun 16, 2010 10:45 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Convert Decimal to hexadecimal Steve Ironmonger DFSORT/ICETOOL 5 Fri May 27, 2016 4:19 pm


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