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
 

 

Problem with numeric operation in outfil. Need help.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Tue Oct 13, 2009 8:06 pm    Post subject: Problem with numeric operation in outfil. Need help.
Reply with quote

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.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

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

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)
/*
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Wed Oct 14, 2009 3:07 pm    Post subject: Reply to: Problem with numeric operation in outfil. Need hel
Reply with quote

Hi Skolusu, I really appreciate your help. Your solution is exactly what I wanted. Thank you so much
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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