Search code examples
ibm-midrangerpg

Is there a workaround for QDMLOPNF 128 limit?


iSeries QDMLOPNF API only returns 128 open files. This limit is quite small for real world (meaning bad designed) applications.

Anyone has came up with a workaround?

TAATOOLS' CVTOPNF is based on QDMLOPNF as well

Thank you


Solution

  • Why do you think there's a limit of 128?

    The API returns the following information:

    • Number of open files available. The number of open files available to be returned.
    • Number of open files returned. The number of complete open file entries that are returned.

    If the amount of space you allocated for the API to use isn't enough to hold all the open files, the two values above will be different.

    Per the APIs by Example: List Open Files API, and the Display Job Open Files Command article,

    Initially, I allocate enough storage to cater for approximately 400 open files. This would cover the storage requirement in most cases. Should it not suffice, however, I repeat the API call following a reallocation of storage based on the actual amount of open file information available.

    Many of the IBM i APIs work in a similar manner.

    The article contains some downloadable code that demonstrate the use of the API.