Having read about the new OS/400 APIs, I thought I'd write a utility that would utilize them. So I wrote a command to perform a generic move of objects and their source code. I created the command and everything was going without a hitch until I used the command to move an object that occurred more than once in my library list.
It seems that the OS/400 QUSLOBJ API operates under different rules than OS/400 commands. '*LIBL' to an OS/400 command means to operate only upon the first occurrence of a particular object in the library list, while to the QUSLOBJ API it means to operate on all occurrences of that object in the library list. Quite a difference!
My report of this problem only resulted in the reply (from Level 2) that it was designed to work that way. Huh? You're kidding!
So be forewarned. There may be some gotchas in the new APIs!
Editor's Note: The fact that some AS/400 manuals are substandard isn't news. All of us have felt, at some time or another, that there aren't enough examples, that the wording is ambiguous or confusing, or that the complete picture is never presented. This is a perfect example. Page 4-4 of the AS/400 System Programmer's Interface Reference (the API manual) describes the use of *LIBL as follows, in the context of the QUSLOBJ API:
"*LIBL (Library list) - This searches all libraries in the user and system portions of the job's library list."
So does the CALL command, when you run it using *LIBL. All libraries in the user and system portions of the job's library list are searched, until the program is found. Common sense seems to indicate here that *LIBL ought to work the same way with QUSLOBJ. However, page 4-2 of the same manual mentions, in passing, that " ... This list is similar to the list returned by the Work with Objects (WRKOBJ) command." If you run WRKOBJ, you'll see that WRKOBJ lists the objects found in all the libraries where found, not only the first one.
Frankly, IBM could have stated that much in plain and simple language in the API manual. David's gripe is justified, and luckily he didn't develop commercial software using this API under the wrong assumption.
LATEST COMMENTS
MC Press Online