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
 

 

Amt sould display x'05' whent he amount is zero for $(9).00-

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kondru

New User


Joined: 22 Mar 2010
Posts: 11
Location: india

PostPosted: Wed May 12, 2010 12:47 pm    Post subject: Amt sould display x'05' whent he amount is zero for $(9).00-
Reply with quote

Hi,
I have a field declared as $(9).99-

Requirement, when this field contains no zeros or spaces i need to plance TAB other wise i need to display the amount in report.

I am trying to do

Move filed-amt to field-temp-amt.
if field-temp-amt not = zeros or spaces
Display field-temp-amt
else
Display tab.

This logic is displaying $.00 ( When the amount is zero).

Could you please any one help me in this context. It should display only TAB ( X'05'), When the amount is zero.

Tegards,
KDR


[/list][/code]
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Wed May 12, 2010 4:56 pm    Post subject:
Reply with quote

You have a logic error. If field-temp-amt is zeroes, then it is not = spaces. If it is spaces, it is not = zeroes. So by the logic rules used by COBOL, your ELSE statement cannot ever be executed.

Furthermore, even if you fix your logic error the ELSE condition will never be executed. As a numeric edited field, field-temp-amt cannot EVER be = ' ' not can it EVER be = '0000000000000' which is what your IF statement is checking for. Your source field, filed-amt (or field-amt, whatever the true name is), may be zero if it is a numeric field -- but your numeric edited field will not ever take on that value.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu May 13, 2010 2:28 am    Post subject: Re: Amt sould display x'05' whent he amount is zero for $(9)
Reply with quote

kondru wrote:
Hi,
It should display only TAB ( X'05'), When the amount is zero.

And what do you expect by displaying a tab character in your output?

All you will get is a single byte of a non-displayable character that probably will show as a punctuation mark when you browse your output.

Line oriented print files do not recognise tab characters, as there are no tabulator positions on a physical line printer.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Thu May 13, 2010 3:16 am    Post subject:
Reply with quote

kondru,
Even if the report is transferred to a PC, nothing guaranties that the tab char will keep your data aligned.
Open the COBOL Language Reference book and check the "BLANK WHEN ZERO" clause, that would be better.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm


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