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

Author Message
giligili

New User

Joined: 07 Jun 2007
Posts: 2
Location: Spain

 Posted: Mon Jun 14, 2010 9:21 pm    Post subject: Is there any way of keeping the decimal part in a DIV? 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.

Skolusu

Senior Member

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

 Posted: Mon Jun 14, 2010 9:23 pm    Post subject: 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.
giligili

New User

Joined: 07 Jun 2007
Posts: 2
Location: Spain

Posted: Wed Jun 16, 2010 6:26 pm    Post subject:

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.
Frank Yaeger

DFSORT Moderator

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

 Posted: Wed Jun 16, 2010 10:45 pm    Post subject: Yes, that's what you need to do.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 5 Fri Apr 20, 2018 4:17 pm How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm Copying part of the report using SARBCH Aedulla CA Products 1 Tue Oct 24, 2017 9:24 am Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm

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