Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us