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

Author Message
bijoybabu83

New User

Joined: 15 Jan 2007
Posts: 36
Location: Kerala

 Posted: Tue Oct 13, 2009 8:06 pm    Post subject: Problem with numeric operation in outfil. Need help. I am performing a numeric operation on some fields in a file of length 133 using OUTFIL. The operation being performed is :- 1. Subtract two Zoned decimal fields in the input file at positions 54 to 63(54,10) and at position 64-73 (64,10). 2. Now divide the answer by the same field in 64-73 (64,10). The two values are :- 0000009087 and 0000009012. Please find the outfil statement that i have written to do the arithmetic calculation. OUTFIL FNAMES=OUTPUT1,OUTREC=(1,73,74:(54,10,ZD,SUB,64,10,ZD), DIV,64,10,ZD,EDIT=(STTTTTTTTT.TTTT),SIGNS=(,-), LENGTH=15,45X). For the above values, the output of this operation is 000000000.0000 whereas the actual values should be 0000000000.0800. Please help me to find out why it is printing wrong values.

Skolusu

Senior Member

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

Posted: Tue Oct 13, 2009 9:07 pm    Post subject: Re: Problem with numeric operation in outfil. Need help.

 bijoybabu83 wrote: The two values are :- 0000009087 and 0000009012. For the above values, the output of this operation is 000000000.0000 whereas the actual values should be 0000000000.0800. Please help me to find out why it is printing wrong values.

how did you end up with 0000000000.0800?

(9087-9012)/9012 = 75/9012 = 0.008322237

If that is what you want then the following Control cards will give you the desired results

 Code: //SYSIN    DD *                                                    SORT FIELDS=COPY                                                  OUTFIL FNAMES=OUTPUT1,                                            OVERLAY=(74:(+10000,MUL,(54,10,ZD,SUB,64,10,ZD)),                            DIV,64,10,ZD,EDIT=(STTTTTTTTT.TTTT),SIGNS=(,-),45X) /*
bijoybabu83

New User

Joined: 15 Jan 2007
Posts: 36
Location: Kerala

 Posted: Wed Oct 14, 2009 3:07 pm    Post subject: Reply to: Problem with numeric operation in outfil. Need hel Hi Skolusu, I really appreciate your help. Your solution is exactly what I wanted. Thank you so much
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Utility for search operation Gopalakrishna551 TSO/ISPF 11 Wed Jan 03, 2018 11:07 am Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm POSSIBLE TO HAVE SAME OUTFIL FNAME? pshongal DFSORT/ICETOOL 9 Wed Nov 29, 2017 3:42 pm Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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