ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

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

  • Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

    Hi all,
    I'm pretty new to RPG, but I've already managed to compile and run the sample RPG application which is described on page 2-4 in the sc415602.pdf (ILE Application Development Example Version 4) and that makes me feel very proud

    Now I wanted to try the example mentioned on the pages 7 to 12 in sc092507.pdf (ILE RPG Programmer's Guide) but I'm not able to compile it because of some severity >30 errors and I don't know where to start fixing these errors.

    I hope you can help me to debug this sample application.
    Ideally we can fix the other errors too (e.g. RNF0394)

    Please find attached the source code and the spoolfile which was created after the unsuccessful compilation.

    Best regards,
    AS400-AT
    Attached Files

  • #2
    Re: Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

    If all I have are severity 30 or lower errors, I usually look for the RNF7030's. Those are field names that havent been defined. By fixing those, they usually also fix other errors that are being generated.

    The field that is not defined is indicator 99. It's used in your printer file, but isnt defined in your program. I suspect that *in99 needs to be changed to *in80, as that is the overflow indicator used on your printer file. (Upon further review, as pointed out by GLS, it appears to be a condition based upon whether an employee record was ound.) The compiler is pointing out that you are conditioning the printer output based upon *in99 being on or off, but you have never what is turning *in99 on or off in your program. So the compiler is saying that you clearly didnt mean to use *In99, and if I were to compile your program, there's no way it would process the way you intended.

    RNF7030 errors usually cause other errors as well, so I usually search and fix all of those, re-compile the program, and see what errors are left after that. You can easily go from a couple of dozen errors down to a few just by fixing an undefined field name.

    The RNF3788 is saying that your "H" spec needs the "DftActGrp(*NO) directive. This is because you are using an ILE concept (subprocedure), and you need to specify that the program is going to utilize the ILE. You do this by simply specfying DtActGrp(*NO) on the H spec.

    Code:
         H DATEDIT(*DMY/) DftActGrp( *No )
    If you fix these two issues, then the third severity 30 error will likely be fixed as well.
    Last edited by MichaelCatalani; October 19, 2011, 11:16 AM.
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

      Hi AS400-AT:
      The 7030 error is from an un-defined indicator (99)
      This code:
      Code:
               chain trn_number emp_rec;
               if %found(emp_rec);
                  pay = CalcPay (emp_rate: trn_hours: trn_bonus);
               endif;
      Should be changed to this:
      Code:
               chain trn_number [COLOR=#ff0000]EMPLOYEE[/COLOR];
               if %found([COLOR=#ff0000]EMPLOYEE[/COLOR]);
                  pay = CalcPay (emp_rate: trn_hours: trn_bonus);
                  [COLOR=#008000]*in99 = *off;
                else
                  *in99 = *on[/COLOR];
               endif;
      The rule of thumb is input =file
      output=record format.

      That should take care of RNF7030 and RNF0394

      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

        @MichaelCatalani
        Thank you for your very valuable input. That hint with DftActGrp( *No ) fixed two severe errors.
        Afterwards, only RNF7030 was present.

        @GLS400
        Thank you also for your very valuable input, especially the precise approach.
        It looks like there is an errata in the ILE RPG Programmer's Guide
        However, now I'm able to compile this program without any warnings, errors or severe errors
        When I call it, the spoolfile QSYSPRT is created as expected.

        Code:
                                     F i n a l   S u m m a r y                                              
           Message Totals:                                                                                  
             Information  (00) . . . . . . . :        5                                                     
             Warning      (10) . . . . . . . :        0                                                     
             Error        (20) . . . . . . . :        0                                                     
             Severe Error (30+)  . . . . . . :        0                                                     
             ---------------------------------  -------                                                     
             Total . . . . . . . . . . . . . :        5                                                     
           Source Totals:                                                                                   
             Records . . . . . . . . . . . . :       71                                                     
             Specifications  . . . . . . . . :       57                                                     
             Data records  . . . . . . . . . :        0                                                     
             Comments  . . . . . . . . . . . :        0                                                     
                  * * * * *   E N D   O F   F I N A L   S U M M A R Y   * * * * *                           
         Program RPGPAYROLL placed in library RPGDEVUSR. 00 highest severity. Created on 19/10/11 at 20:53:06.
                   * * * * *   E N D   O F   C O M P I L A T I O N * * * * *

        Comment


        • #5
          Re: Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

          Consider using WDSC or RDPi to write or edit your source. If would have shown up these errors during "verify" before you even attempted to compile.

          Comment


          • #6
            Re: Compilation of the payroll example fails: RNF3788, RNF7030, RNF7503

            Originally posted by AS400-AT View Post
            @MichaelCatalani
            Thank you for your very valuable input. That hint with DftActGrp( *No ) fixed two severe errors.
            Afterwards, only RNF7030 was present.
            One thing to keep in mind is that the manual you were using was V4. At that time, using the compiler directive DtActGrp on the H spec wasnt available. The only way to make the program ILE was to prompt the compile command, and specify *NO for the default activation group. So the manual you are using wouldnt have had the directive in the H spec, because it wasnt allowed at that time. (I cant remember when they added it to the H spec, but it seems like it was around V5.) In any case, always use the H spec to specify compiler directives, as this allows a programmer behind you to simply perform a default compile, and all of the directives will be picked up automatically.


            For instance, if you want to compile an ILE program and have it run in the named activation group of "ORDERENTRY" and use a binding directory of "MYBIND", then the "old" way to do it would be to specify the parameters on the compile. ie:

            CRTBNDRPG PGM(PROGRAM) DFTACTGRP(*NO) ACTGRP(ORDERENTRY) BNDDIR(MYBIND)

            And that worked. The problem is that a programmer making changes at some piont in the future would have to know to specify the compile command exactly this way on future compiles, or else the activation group wouldnt be right, and the binding step would fail because it wouldnt be pointing to the binding directory required for binding.

            So the old school way was to document the compile command as a comment at the top of the program. Any other programmer needed to know to check this comment section to look for compiler parameters that they needed to add. It was a pain in the butt, sometimes required a lot of keying, and if the comments that documented the compile were incorrect, required a lot of research to find everything needed.

            But the newer and much better method is to specify them on the H spec.

            Code:
            h DftActgrp( *No ) BndDir( 'ORDERENTRY' ) BndDir( 'MYBIND' )
            With the parameters specified on the H spec, the compile command will pick these up automatically.Any programmer in the future can make their changes, and simply use a default recompile, and have these requirements picked up automatically.

            But the main point I was making was that you wouldt have seen this method in the V4 IB manual, because at the time it wasnt allowed.
            Last edited by MichaelCatalani; October 19, 2011, 02:00 PM.
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment

            Working...
            X