Gotcha! API Gotcha

APIs
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: