ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

What is the equivallent of a *Entry PLIST in /Free?

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

  • #16
    Re: What is the equivallent of a *Entry PLIST in /Free?

    to call them from RPG...yes. any program call can be prototyped
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #17
      Re: What is the equivallent of a *Entry PLIST in /Free?

      Originally posted by tomholden View Post
      to call them from RPG...yes. any program call can be prototyped
      Sorry...maybe I didn't state it properly or don't understand your reply. I was referring to the calling of an RPG /FREE program from a CL program:
      Code:
      DCL        VAR(&BRANCH)    TYPE(*CHAR) LEN(12)
      
      CALL       PGM(OE287E1) PARM(&BRANCH)
      Based on the example above, would it look like this:
      Code:
      [COLOR=#000000][COLOR=#0000BB]     D Main            pr                  extpgm[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'OE287E1'[/COLOR][COLOR=#007700]) 
           [/COLOR][COLOR=#0000BB]D  Branch                      12 [/COLOR][/COLOR][COLOR=#000000][COLOR=#0000BB]
      [/COLOR][/COLOR]

      Comment


      • #18
        Re: What is the equivallent of a *Entry PLIST in /Free?

        If your RPG program has a pi to match the pr you posted above, then yes you can call it from a CL just like that.

        Comment


        • #19
          Re: What is the equivallent of a *Entry PLIST in /Free?

          Thanks! Great to know...next time I'm doing maintenance there will be some changes made

          Comment


          • #20
            Re: What is the equivallent of a *Entry PLIST in /Free?

            Given Terry's CL example, I would expect the 7.1 code to be as simple as:

            Code:
                 D                 pi                  
                 D  Branch                      12
            In older releases you'd have to code:

            Code:
                 D Main            pr                  extpgm('OE287E1') 
                 D  Branch                      12 
                 D Main            pi
                 D  Branch                      12
            Remember the idea here is to replace *ENTRY, he's not going CALL OE287E1, the call is comng from CL. That's why I campaigned IBM to release the PR restriction -- it's just duplicated and unnecessary code for stuff like this.

            Comment


            • #21
              Re: What is the equivallent of a *Entry PLIST in /Free?

              Dropping the PR requirement in 7.1 has really cleaned up the program code. Especially if you utilize subprocedures in lieu of subroutines. Prior to V7.1, the entire top of the program would be littered with useless PR specs.

              One thing I would advise caution on; For your service programs, you need to ensure that the service program module has the /copy for the prototype specs in it. If you don't, then the service program module will auto-gen them. An issue I can see is where some change management process fails to move the prototype copy member in the final step, performs a compile on the service program and all associated programs bound to it, and the programs get compiled with a different set of prototypes than the service program. (Which could lead to runtime failures) It may not be a very likely scenario, but it would be nasty if it happened.
              Michael Catalani
              IS Director, eCommerce & Web Development
              Acceptance Insurance Corporation
              www.AcceptanceInsurance.com
              www.ProvatoSys.com

              Comment


              • #22
                Re: What is the equivallent of a *Entry PLIST in /Free?

                Originally posted by MichaelCatalani View Post
                One thing I would advise caution on; For your service programs, you need to ensure that the service program module has the /copy for the prototype specs in it. If you don't, then the service program module will auto-gen them.
                Well, now you're changing the subject :-) This thread was about *ENTRY PLIST in free format -- thus I think it implied we were NOT discussing subprocedures.

                For EXPORTED subprocedures in a module (including those that will become service programs) I agree with you, put prototypes in a copy book, and make sure they are copied into both caller and callee.

                However, for non-exported subprocedures, there's no point in this. Just use the PI.

                Comment

                Working...
                X