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 ADD function.

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

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Feb 16, 2009 12:47 pm    Post subject: Problem with ADD function.
Reply with quote

Hi,
I was trying to add few columns along the same row. I used the code as listed below using ice tool. My expected O/P is in the form of ZD but i was getting something different.

Code:

OUTREC IFTHEN=(WHEN=INIT,                                     
        OVERLAY=(406:C'00000{',412:C'00000{',                 
 418:(365,14,ZD,ADD,337,14,ZD,ADD,323,14,ZD,TO=ZD,LENGTH=14)))


Th I/P file has Lrecl of 433 (FB) and so as the O/P.
the fields which i want to sum up is of length 14. The corresponding Cobol declaration is "S9(10)V9(4)".

My field A,B,C has the following values:
A= 0000000209120M
B= 0000000000000{
C= 0000000000000{

My O/P is something like this: 2091204- (Even though the computed value is correct, it is not displayed as 0000000209120M).

Pls let me know whats wrong and pls try to suggest a solution in ICETool rather than in ice man or in other ... (Because this particular case is one of the condition which needs to be implemented in a single control card... )

Thanks in Advance.
Back to top
View user's profile Send private message

samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Feb 16, 2009 4:38 pm    Post subject:
Reply with quote

I think the O/P is editted before they are displayed... Pls let me know if there is any way to display the ZD value as it is (without editting or formatting) ...
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: Mon Feb 16, 2009 10:10 pm    Post subject:
Reply with quote

I'm not sure how you're getting what you say you're getting. M is X'D4' which is a -4. With TO=ZD, you should get a D sign. But your syntax does seem to have the parens in the wrong places. Try this:

Code:

  OUTREC IFTHEN=(WHEN=INIT,                                         
        OVERLAY=(406:C'00000{',412:C'00000{',                       
   418:(365,14,ZD,ADD,337,14,ZD,ADD,323,14,ZD),TO=ZD,LENGTH=14))   


You can also use TO=ZDF if you want an F sign for positive values or TO=ZDC if you want a C sign for positive values. For DFSORT, TO=ZDF and TO=ZD are equivalent.
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Tue Feb 17, 2009 2:29 pm    Post subject:
Reply with quote

Quote:

But your syntax does seem to have the parens in the wrong places
?


Ya..there braces wer not in places... I have corrected that.

Pls let me know how to identify whether there is a overflow or not ?
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: Tue Feb 17, 2009 10:22 pm    Post subject:
Reply with quote

Quote:
Pls let me know how to identify whether there is a overflow or not ?


Huh? Who said anything about overflow? Overflow of what?
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Wed Feb 18, 2009 6:22 pm    Post subject:
Reply with quote

I have to multiply a big number ( 9(10)V9(4) with another 9(10)V9(4) ) so i ll get a number larger than the 10 digits. If I mention the length as 10, will this not truncate the result. How do i make sure that there is no overflow/truncation in the result.Any specific method to identify.Pls clarify me on this.


Thanks,
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 Feb 18, 2009 10:35 pm    Post subject:
Reply with quote

To avoid overflow, just use a LENGTH=n value that will allow for the largest result possible. The number of digits can be up to 31. n can be up to 44 (to allow for separators, etc). So, for example, you could use

...,TO=ZD,LENGTH=31
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 LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
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

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