ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

AS400 Reports

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AS400 Reports

    Hi all,

    I have a numeric field of length 7, 2, if that some other field say xx is zeros, I have to display only 0 in the numeric field.

    I am trying, but it is still displaying as 00000.00


    Any help

    Thanks
    hsp
    'Coding = Experience'
    hsp

  • #2
    Re: AS400 Reports

    use edtcde(Z) to suppress leading zeros...or use an edit-word, most programmers with more than 1 year 'Coding=Experience' would know that already. also as i said before...give your topics a better description, not just reiterate the forum subject...sheesh
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: AS400 Reports

      I already used, edtcde(z) even i used edtcde(4), not getting..

      My question is #INCAMT which is of length 7,2

      While displaying, this #INCAMT, must show single 0 alone ( 0) if the populating field is zeros.

      Hope u understand it...


      Also, Tom, for your information I tried and scratched my head, then I taught will get some help from forum, so i posted...

      The description for posting surely will correct it.. thanks for correcting me regarding that context.

      Thanks
      hsp
      'Coding = Experience'
      hsp

      Comment


      • #4
        Re: AS400 Reports

        Hi,

        Tom, if u give me which editwrd to be used it will be great
        'Coding = Experience'
        hsp

        Comment


        • #5
          Re: AS400 Reports

          RPG Tutorial: Output edit words --> link

          From the tutorial, we learn:

          RPG, like most programming languages, has a mechanism for editing numeric data.
          Typical editing involves suppression of leading zeros, inserting commas and decimal points, inserting fixed or floating dollar symbols to clarify monetary amounts, and providing sign status (+/- or DB/CR).

          Here is the general rule to follow for forming edit words for zero suppression:

          A zero (0) is used to stop zero suppression.
          It is placed in the rightmost position where zero suppression is to take place.
          It will be replaced with the character from the corresponding position of the data field, unless that character is a zero.
          At least one leading zero is suppressed.

          If you do not want any leading zeros suppressed, make the edit word one character larger than the data field and place a zero in the first position of the edit word.

          Experience is a hard teacher because she gives the test first, the lesson afterwards.

          Comment


          • #6
            Re: AS400 Reports

            Thanks a lot...

            I got the display as ( 0), but it is writing 0 even if the in blanks space also.

            O/P :
            37.50 40.00 0 37.91 101
            85.99 91.99 0
            123.49 131.99 0 37.91 31
            0

            This extra 0 is coming, i debuged the program, in program it is not a problem.

            I used the edtwrd(' 0 ').

            Any help...

            Thanks
            hsp
            'Coding = Experience'
            hsp

            Comment

            Working...
            X