Edit Code for Negative Signs

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

From: Bruce Ballehr To: All

I'm trying to define a field so it can be either positive or negative. If negative, the sign would be on the right of the number. This is an input/output field. I define the field as six bytes, three decimals, both input and output, with an edit code of L. My desire is for the user to be able to type, for example, 5.0, then press the minus field exit key to result in the field looking like 5.000-.

The problem is the minus sign does not display; the hexadecimal letter for a negative zero displays instead. If I move this field to a field defined exactly as this but output only, it displays as 5.000-. What am I doing wrong?

From: Dave Shaw To: Bruce Ballehr

That's the way it works. If you redisplay the field, it will appear as you want it. This is the way field minus has always worked on the S/38 and AS/400.

There is an alternative. If, instead of using field minus, you use a dash (the - key next to the 0 in the alphanumeric section of your keyboard), and then a field exit, it will look the way you want it to and be read by the system as a negative. I wish I had a better answer for you, but this is about the best that can be done given the limitations IBM currently has in place.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: