ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

QCLRPGMI API not returning source info

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

  • QCLRPGMI API not returning source info

    Hi,

    I was trying to get the name of the source file and library that compiled a program object by using the QCLRPGMI API.



    But it keeps coming up as blanks. Same thing for QUSROBJD, both show source file info as blank.

    Anything I can do to get that info?
    Greg Craill: "Life's hard - Get a helmet !!"

  • #2
    Re: QCLRPGMI API not returning source info

    If it's an ILE program you won't get this information, because always a 2 step compilation is performed, i.e. a module is generated and bind after into a program.
    You need to analyze the appropriate module (if it is not deleted).
    API QBNRMODI - Retrieve Module Information

    Birgitta

    Comment


    • #3
      Re: QCLRPGMI API not returning source info

      do a site search for QBNRMODI

      Click image for larger version

Name:	Image 2.png
Views:	1
Size:	165.8 KB
ID:	126721
      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


      • #4
        Re: QCLRPGMI API not returning source info

        Thanks Birgitta, Modules are no longer with us, oh well a nice idea.
        Greg Craill: "Life's hard - Get a helmet !!"

        Comment


        • #5
          Re: QCLRPGMI API not returning source info

          Consider using QBNLPGMI. This will let you get the list of modules and their respective source members from the *PGM object (Even if the *MODULE objects are long gone.)

          There's also QBNLSPGM that will get the list of modules and respective source members from service program (*SRVPGM) objects.

          Comment


          • #6
            Re: QCLRPGMI API not returning source info

            Reading Scott's example now http://www.think400.dk/apier_2.htm#eks0006
            Greg Craill: "Life's hard - Get a helmet !!"

            Comment


            • #7
              Re: QCLRPGMI API not returning source info

              Oh, wow... that's a REALLY old example. Forgot all about it.

              Comment


              • #8
                Re: QCLRPGMI API not returning source info

                suppose you're a really old genius then Scott

                That old example works a treat, gives me the source file name etc for the program when no module exists. Thanks Heaps!
                - and thanks to the crew at think400 for hosting the examples!
                Greg Craill: "Life's hard - Get a helmet !!"

                Comment


                • #9
                  Re: QCLRPGMI API not returning source info

                  Is there a crew at think400.dk? I thought it was just Leif Guldbrand.

                  The example that you cite was not designed to get the source info (though, that info is in there, of course.) It was intended to find the program objects given a module name, which was something I needed since I had modules at the time that were bound to many programs, and I needed to be able to find them.

                  Eventually, though, I stopped using it because (1) I had too many ILE programs, and they no longer fit in the user space. And (2) I stopped using modules that way, and just put them into a service program. That program is from 1997, so 16 years ago... if I rewrote it today, I'd use qualified DSes, free format, etc. would be nicer to read.

                  Glad it's useful to you, though.

                  Comment


                  • #10
                    Re: QCLRPGMI API not returning source info

                    My coding is pretty ugly Scott, I am mainly self taught and don't utilise features I should, and don't understand others. I use a lot of stuff from think400/code400 and adapt to suit my purpose, but I wouldn't want anyone actually reading it - it's a bit barbaric and would likely cause much coffee spitting ...
                    Greg Craill: "Life's hard - Get a helmet !!"

                    Comment


                    • #11
                      Re: QCLRPGMI API not returning source info

                      Originally posted by Scott Klement View Post
                      Is there a crew at think400.dk? I thought it was just Leif Guldbrand.
                      Scott,
                      As usual.... you're right :-)

                      Leif Guldbrand

                      Comment


                      • #12
                        Re: QCLRPGMI API not returning source info

                        Originally posted by Leguar View Post
                        Scott,
                        As usual.... you're right :-)

                        Leif Guldbrand
                        Thanks again Leif - a lot of good resource on your site!

                        Greg
                        Greg Craill: "Life's hard - Get a helmet !!"

                        Comment


                        • #13
                          I am trying to retrieve the program source code information (Source File and Source Member) for all the programs in a given library.

                          I downloaded Scott Klement's QBNLPGMI API from Think400.dk .
                          I called it passing a single program name but it hit a CPF3CAA error - List is too large for user space MODULES.

                          Does anyone have more info?
                          Has anyone come up with a version that will accept a library for which the source information for every program in that library will be retrieved.
                          Has anyone modified it to write out to a database file vs a print file?

                          Please reply to mhall@polarbev.com

                          Comment


                          • JonBoy
                            JonBoy commented
                            Editing a comment
                            Please don't request responses directly to your email. These lists are for sharing information and if it comes to you nobody else will know.

                            Instead change your list preferences so that you'll be notified by email of any responses.

                            Hopefully someone else can help you because I cannot find the version of the program that I used to do this (which did create a database).
                            Last edited by JonBoy; February 5, 2020, 10:53 AM.

                        • #14
                          Originally posted by ridgeline View Post
                          CPF3CAA error - List is too large for user space MODULES.

                          Does anyone have more info?
                          Errrm... it means that the list is too large for the user space. You see, QBNLPGMI creates a list of data and places it in a user space... and user spaces have a maximum size of 16 mb. So, if the data is larger than 16mb it won't fit in the user space. Consider changing your program to request less information at once.

                          Comment


                          • #15
                            What IBMi Release you are on?
                            If you are on Release 7.3 or Release 7.4 (latest TR), you may also check whether the following IBM Services (Views) in the QSYS2 libary, deliver what you need.
                            QSYS2 BOUND_MODULE_INFO VIEW
                            QSYS2 BOUND_SRVPGM_INFO VIEW
                            QSYS2 PROGRAM_EXPORT_IMPORT_INFO VIEW
                            QSYS2 PROGRAM_INFO VIEW
                            It could be you'll get the same problems because of the Maximum User Space (I assume these views are also based on System APIs)
                            Birgitta

                            Comment

                            Working...
                            X