ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to Retrieve All Binding Directory In a program.

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

  • How to Retrieve All Binding Directory In a program.

    Hi, I google a few days,
    But there is not much information.

    Does anyone know what command, API or any open source tool can help on it ?

    Your help is greatly appreciated. Thank you !!!!

    Further clarify:-

    Sorry, seen my question is confusing.
    Let me further clarify.

    When I create RPG prgmA I using

    Default activation group . . . . > *NO
    Activation group . . . . . . . . ActiG
    Binding directory . . . . . . . BINDA1
    Library . . . . . . . . . . .
    + for more values BINDA2

    After completed. I using dsppgm, it would only show the first Binding directory and the second is not show.
    Any API or command or anything can using to view all the BIND ???

  • #2
    Re: How to Retrieve All Binding Directory In a program.

    unless you have the compile command used to create the program or the binding directories are on the H spec...you're screwed. now for the big question, did you mean service programs or modules or binding directories? binding directories may not tell you what you are after since they can have 1 or many service programs and/or modules in them. to see the number of service programs and modules use DSPPGM and that is on the 1st and 2nd screens. module details are on the 3rd screen, service programs used are on the 4th screen, and you can "drill down" to see the procedures available from there. there are APIs to retrieve this same information. it really depends on what you are looking for...
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: How to Retrieve All Binding Directory In a program.

      Hi denvertan:

      I think this is what you are looking for:
      Code:
      DSPOBJD OBJ(*ALL) OBJTYPE(*BNDDIR) OUTPUT(*OUTFILE) OUTFILE(QTEMP/JUNK)
      qtemp/junk now has a listing of all binding directories in your library list.

      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: How to Retrieve All Binding Directory In a program.

        Too see what modules and service programs are bound into a program, just use the DSPPGM command.

        Comment


        • #5
          Re: How to Retrieve All Binding Directory In a program.

          Sorry, seen my question is confusing.
          Let me further clarify.

          When I create RPG prgmA I using

          Default activation group . . . . > *NO
          Activation group . . . . . . . . ActiG
          Binding directory . . . . . . . BINDA1
          Library . . . . . . . . . . .
          + for more values BINDA2

          After completed. I using dsppgm, it would only show the first Binding directory and the second is not show.
          Any API or command or anything can using to view all the BIND ???

          Comment


          • #6
            Re: How to Retrieve All Binding Directory In a program.

            A binding directory is only used at compile time (binding step) to find the modules and service program to bind to the (service-)program object.
            If you have to use more than one binding directory add an H-Spec BNDDIR where you list all binding directory you want to use.

            IMHO the best way is to have only a single binding directory where all your service program are listed.
            If not possible you may have a binding directory per application or library.
            A service program should only be listed in a single binding directory.

            I wouldn't add modules to a binding directory. Currently I only bind a single module (with lots of exported procedures) to a service program. This service programs are added to a single binding directory (per application even though I'd prefer having only a single binding directory for ALL applications). When creating a program also only a single module is bound, but the binding directory is listed in the H-Spec. If I have to use procedures located in different applications I list all binding directories in the H-Specs (what could be avoided if only a single binding directory would be used).

            What I've also seen, but IMHO does not make sense is to create a binding directory per program or service programs where all the modules and service programs bound to the program or service program are listed. Not only the binding directory must be actualized manually, you may also get trouble with duplicate procedures if the same module or service program is listed in serveral binding directories. (and specifying allow duplicate procedures may cause more problems that you can imagine).

            In either way there is no way to get information about the binding directories used (not even with APIs) you only get information about the bound modules or service programs.

            Birgitta

            Comment


            • #7
              Re: How to Retrieve All Binding Directory In a program.

              I see, define the binding directory in H-spec seen the best practice.
              But to do it now... I need to have a set of tool or a way to see the binding directory it use..

              Comment


              • #8
                Re: How to Retrieve All Binding Directory In a program.

                Originally posted by B.Hauser View Post
                If you have to use more than one binding directory add an H-Spec BNDDIR where you list all binding directory you want to use.
                FWIW even if there's only one binding directory it goes into an H spec. if i have to add more binding directories later it's simple plus i don't have to remember to add the binding directory to the compile command via prompt. it's also easier to ensure that the next programmer touching the program also compiles the program correctly.
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: How to Retrieve All Binding Directory In a program.

                  Originally posted by tomholden View Post
                  FWIW even if there's only one binding directory it goes into an H spec.
                  Yep, agreed. It's also easier and less error prone to simply add the BNDDIR directive on H spec than it is to document inside the program which binding directories / modules / service programs to use at compile time. The documentation is rarely correct if the program is heavily modified, and I hate going on a snipe hunt trying to figure out which modules / service programs are needed by the program. If the modules and service programs are contained in a binding directory, and the binding directory is specified on the BNDDIR directive on the H spec, then all I have to do is tell the program to compile.
                  Michael Catalani
                  IS Director, eCommerce & Web Development
                  Acceptance Insurance Corporation
                  www.AcceptanceInsurance.com
                  www.ProvatoSys.com

                  Comment

                  Working...
                  X