Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Anyone know how to list OBJTYPES?
has no ratings.
Published: 19 Feb 2013
Revised: 20 Feb 2013 - 4110 days ago
Last viewed on: 21 May 2024 (4814 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Anyone know how to list OBJTYPES? Published by: Bob Cozzi on 19 Feb 2013 view comments(2)

I thought there was an API that would generate a list of the IBM i object types, *PGM, *CMD, *FILE, etc. I know there is an API to convert from the *PGM to the hex notation for the object type, but I can't find one that actually lists the available object types.

What I want to do is create a CMD that, when prompted lists the available object types instead of having to hard code them into the command. I thought they gave use this like 20 years ago. Maybe it was an old MI routine? Anyone know/remember?

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: Ringer
Premium member *
Comment on: Anyone know how to list OBJTYPES?
Posted: 11 years 3 months 2 days 8 hours 20 minutes ago
Edited: Tue, 19 Feb, 2013 at 16:49:59 (4111 days ago)

You could iterate through 256 hex combinations and use the ones where an error code is not generated. Probably not what you are looking for.



D* Get object type's OS/400 Hex Value                  
D QLICVTTP        Pr                  ExtPgm('QLICVTTP')
D  CvtType                      10a   Const            
D  ObjType                      10a   Const            
D  HexType                       2a   Const            
D  ErrorCode                            LikeDS(@ErrData) 
D                                            Options(*Omit)   

Chris Ringer

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Anyone know how to list OBJTYPES?
Posted: 11 years 3 months 1 days 16 hours 24 minutes ago

Article from MC Press: http://www.mcpressonline.com/rpg/want-to-know-all-the-mi-object-types-supported-by-your-ibm-i.html. He uses headers (/COPY's) from his i5 Tooklit, which is open source (there's a link). Even if you don't use his code, there's a lot of good info there; might be worth a look.