ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Calculation Specifications

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

  • Calculation Specifications

    Hey again

    i found also this part of code in the same tutorial
    but is it allowed in RPG to code the / sign
    will this function u think?

    Calculation Specifications
    *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+...
    /free
    chain trn_number emp_rec;
    if %found(emp_rec);
    pay = CalcPay (emp_rate: trn_hours: trn_bonus);
    endif;
    /end-free


    thanks!!!

  • #2
    Re: Calculation Specifications

    Yes it is allowed in the FREE FORMAT RPG. The demarcations having the keyword FREE and the statements ending with a ';' can tell you that this is a free format version of the good old RPG.

    Comment


    • #3
      Re: Calculation Specifications

      will this work also in RPG IV???

      this is the code i want :

      /free
      chain trn_number emp_rec;
      if %found(emp_rec);
      pay = CalcPay (emp_rate: trn_hours: trn_bonus);
      endif;
      /end-free

      Comment


      • #4
        Re: Calculation Specifications

        will this work also in RPG IV???

        this is the code i want :

        /free
        chain trn_number emp_rec;
        if %found(emp_rec);
        pay = CalcPay (emp_rate: trn_hours: trn_bonus);
        endif;
        /end-free

        Comment


        • #5
          Re: Calculation Specifications

          Yes the free format code (above) will work in RPG IV.

          Comment


          • #6
            Re: Calculation Specifications

            but you will need to have the procedure CalcPay defined.

            jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: Calculation Specifications

              mmm it is not working with me....

              Comment


              • #8
                Re: Calculation Specifications

                Post your code so we can look at it.
                Never trust a dog to watch your food.

                Comment


                • #9
                  Re: Calculation Specifications

                  You cant just run the code you found in a book....
                  you dont have the employee file with record format emp_rec
                  and I believe you also dont have the procedure CalcPay

                  just let us know
                  All my answers were extracted from the "Big Dummy's Guide to the As400"
                  and I take no responsibility for any of them.

                  www.code400.com

                  Comment


                  • #10
                    Re: Calculation Specifications

                    Free format is one way of writing RPGIV itself.
                    It may not work if you are at a lower version of OS/400 (free format came into being with V5R2, didn't it?)
                    â??No bird soars too high if he soars with his own wingsâ?? â?? William Blake

                    Comment

                    Working...
                    X