ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

API to retrieve source members

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

  • API to retrieve source members

    I have need to retrieve a list of source members in a source file and then work with the list in my program. I realize I could do a DSPFD to an outfile and read that but I would prefer to use an API to retrieve the list into a multiple occurrence DS or array and then process the mods/array.

    Does anyone know of an API to do this an possible examples?

  • #2
    The only API I know is QUSLMBR (List Database File Members - https://www.ibm.com/support/knowledg...br.htm?view=kc) the data is returned in a user space and data must be read from the user space.
    But ... why not reading the members (Member = TABLE_PARTITION) with embedded SQL from the SYSPARTITIONSTAT catalog view in the QSYS2 library and fetching data into an array data structure.

    Birgitta
    Last edited by B.Hauser; October 21, 2017, 01:51 AM.

    Comment


    • #3
      Thanks Birgitta, that should work for me,

      btw, is there a way to tell if the file represented by column TABLE_NAME in SYSPARTITIONSTAT is a source file or not. I am only interested in members in a source file. Maybe I just need to use the DSPFD ==> *OUTFILE approach

      Comment


      • #4
        Code:
        select * from qsys2/systables
        where file_type = 'S'
        Regards

        Kit
        http://www.ecofitonline.com
        DeskfIT - ChangefIT - XrefIT
        ___________________________________
        There are only 3 kinds of people -
        Those that can count and those that can't.

        Comment

        Working...
        X