Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


zero with field format D12.1

zero with field format D12.1

zero with field format D12.1


I compute a field in my report where I use an if statement to say: use the given formular if any of the formular elements are not equal to zero. If not print zero.

What happens is that in the "print zero" case I receive a ,0 in my report instead of a simple 0. This might be due to the fact that the format of the computed field is D12.1. How can I achiev a simple 0?


RE: zero with field format D12.1

Hey did you try using edit on that zero or may be do a decode and if its ,0 then display a field which is integer 0.


decode (formular,<> 0 ,0,= 0,formular)

see if this thing works , may be i would have understood ur ? wrong.
Thank you.


RE: zero with field format D12.1

You can also define the field with the 'S' edit option, for zero suppress (D12.2S).

RE: zero with field format D12.1

Hello Ganesh,

Can you tell me something about your code line? I have never seen that before.

Hi focwizard,

I'd like to display the zero. The S option prints nothing if the value is zero.


RE: zero with field format D12.1

The field type determines the output display, so a D12.1 will show .0 by default. Try using a D12, a P12 or an integer field (I5 etc). These all show a single zero but some may not be suitable for calculations involving decimal places, as P format will round up and I format will truncate.

RE: zero with field format D12.1

Hi Eva are you asking abt Decode , think you can easily do a decode for that .

RE: zero with field format D12.1

Hi Peter,

the problem is that I need the D12.1 format for all fields which are not equal to zero.

Hi Ganesh,

can you explain me with an example how you mean the DECODE in your first answer?


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close