Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Fetching all the objects in the AS/400 system

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

  • Fetching all the objects in the AS/400 system

    Hi, I am writing an application wherein, i need the names of all the objects in the AS/400 system. Even though, i can get it using DSPOBJD( and reading the outfile) or DSPLIB( and copying the spool file to get the object names), it takes too much of time. Can anybody suggest a way in which, this can be done faster. This is an interactive application. Thank you Suraj

  • #2
    Re:Fetching all the objects in the AS/400 system

    The fastest method is to use unix API ReadDir this enables you to access QSYS via the IFS and does not load objects to memory before outputting to disk. At least 20 times faster.

    Comment


    • #3
      Re:Fetching all the objects in the AS/400 system

      Or you can use this trusty API - http://publib.boulder.ibm.com/infoce...is/quslobj.htm
      List Objects (QUSLOBJ) API Required Parameter Group: 1 Qualified user space object Input Char(20) 2 Format name Input Char(8) 3 Object and library name Input Char(20) 4 Object type Input Char(10) Optional Parameter Group 1: 5 Error Code I/O Char(*) Optional Parameter Group 2: 6 Authority control Input Char(*) 7 Selection control Input Char(*) Optional Parameter Group 3: 8 Auxiliary storage pool (ASP) control Input Char(*) Default Public Authority: *USE Threadsafe: Yes The List Objects (QUSLOBJ) API lets you generate a list of object names and descriptive information based on specified selection parameters. This API returns information similar to the Display Object Description (DSPOBJD) command. An advantage over the DSPOBJD command is that you can perform authority checking on the objects and libraries. You can get a list of objects with only a certain status, which you cannot do with the DSPOBJD command. The QUSLOBJ API places the list in the specified user space. The generated list replaces any existing list in the user space. You can use the QUSLOBJ API to: * List objects in a library * List objects of only one type * Write an application program to move programs from the QRPLOBJ library (or the QRPLxxxxx library where 'xxxxx' is the number of a primary auxiliary storage pool) back to where they were originally located * Provide backup analysis based on when the object was last saved or last updated * Provide source member and object analysis from source member information to verify that the current source was used to create the specified object The QUSLOBJ API returns information in several formats. All formats except OBJL0100 include an information status field that describes the completeness and validity of the information. Be sure to check the information status field before using any other information returned.

      Comment


      • #4
        Since this is an interactive program I would suggest you go for Open List APIs, QGYOLOBJ should get you what you are trying to achieve. The good thing about open list APIs is that you can tell the API to return a specified number of entries and while you process those the API keeps on building the rest of the list. So like in your case you can ask it to give you the first 500 objects do whatever you want to do with these 500 objects and in the meanwhile the API will keep on building the full list in the background, once you have processed the first 500 objects and are ready to process the rest of the objects you can ask the API to give you more objects to work.

        Comment

        Working...
        X