ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Built Library List from a JOBD

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

  • Built Library List from a JOBD

    Hello and thank you in advance for your help.
    I have to build a library list from a JOBD that is passed to me as parameters. Is this possible and if so how I will be able to read the JOBD libraries in a program (CL,RPG,RPGLE)
    Regards​

  • #2
    The simplest thing would be to submit a job using the jobdescribtion ( SBMJOB JOBD(MYJOBD) INLLIBL(*JOBD) )
    then retrieve the user library list (RTVJOBA)

    Comment


    • #3
      You can use the SQL View JOB_DESCRIPTION_INFO to get the LIBL from a JOBD.

      Comment


      • #4
        But JOB_DESCRIPTION_INFO just returns the value in the job description - for example *SYSVAL
        The other way around the operating system will give you the user library list

        Comment


        • #5
          Peder brings up the case where a job description could have *SYSVAL for the initial library list, however if you wanted to avoid submitting a seperate job you could check if the library list value was *SYSVAL from the JOB_DESCRIPTION_INFO​ view and if so, use the SYSTEM_VALUE_INFO view to retrieve the library list from the QUSRLIBL system value.

          Comment


          • #6
            If you just want to set the library list of the current job using a passed-in JOBD, then you can use QCMDEXC to execute command 'RPLLIBL JOBD(' + qualifiedJobDName + ')'

            If you want to read through the libraries in your program then as others have said you can use SQL Views JOB_DESCRIPTION_INFO and SYSTEM_VALUE_INFO

            Comment


            • #7
              I can't find anything about the RPLLIBL command.

              Comment


              • #8
                I'm so sorry, I forgot that was a custom command of ours.

                You can also do command 'CHGLIBL LIBL(' + Library_List + ')' where Library_List is the column from JOB_DESCRIPTION_INFO or SYSTEM_VALUE_INFO

                Comment


                • Vectorspace
                  Vectorspace commented
                  Editing a comment
                  Note that SYSTEM_VALUE_INFO libl does not have spaces between library names, so 10 char length libraries will break it, so you may need to transform it first

              • #9
                Thank you all for your answers, I will study all this. Cordially

                Comment

                Working...
                X