ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Example how to retrive file's library

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

  • Example how to retrive file's library

    Hi all

    i need, inside and RPG program to retrive the file's library ; this file is not used inside the program. can some one post a simple example how do that with an Apy or other way ?

    Thanks in advance

  • #2
    Re: Example how to retrive file's library

    cheap and cheesy way would be to call a CL with parameters * use RTVOBJD &yourfile RTNLIB(&yourreturnparm) and return that to your RPG. or you can use the QUSROBJD API in your RPG. I don't have an example handy and no time to code it for you.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Example how to retrive file's library

      You also can access the SYSTABLES catalog view and search for the file (and all occurences of the file in all libraries).
      If you want to know in which library a file in the library list is, you may call the API QDBRTVSN (Retrieve Short Name).
      It retrieves the system name and system library for any file (indepenent whether the short system name or the long SQL name was specified), in either a specific library or in the current library list.

      Birgitta

      Comment

      Working...
      X