Home > AS/400 Tips > iSeries administrator tips > APIs and exit programs: Thousands of lines of free code
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

APIs and exit programs: Thousands of lines of free code


Ron Turull
10.11.2006
Rating: -4.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



Ron Turull
You can shave hours off of your development time by taking advantage of thousands of lines of free code IBM has given all of us. Many of the System i-iSeries system APIs and exit programs take parameters that can get quite complex; that is, a parameter can be formatted as a data structure containing many subfields -- sometimes as many as 30 or 40. Defining these data structures is a time-consuming chore and a waste of your valuable talents. The IBM-provided code contains predefined data structures and constants for most, if not all, of the system APIs and exit programs.

How to take advantage of this code

The free code is in the form of copy members (also known as header files and include files) and can be found in the QSYSINC library, which stands for 'system includes' (the word 'includes' is the C language terminology for copy member). Each language has its own file. The chart below will help you locate the file appropriate for the language you are using.

Quick reference to copy files in QSYSINC

Tips for locating the proper member

Once you have determined which file you need, you'll need to locate the appropriate file member. Because there are so many copy members in each of these files and many of their names apparently have no relation to their contents, finding the right member can be tough. Try these two tricks to lessen the burden:

1. Search through the contents of all the members for the name of the API you are using (e.g., QMHRDQM). To search through all the members in a file, "open" the file in PDM (use the WRKMBRPDM command to get into PDM). Then, type option 25 next to the first member listed and press F13 (this will copy the option 25 to all the members in the list). Next, press Enter and the Search Options screen will appear, where you can type the name of the API (or any other text) you want to search for. Finally, press Enter and the system will start searching through the members.

2. A quicker, but less effective, method involves searching just the text descriptions of the members. You can do this by pressing F17 to bring up the Subset Member List screen and specify criteria to subset the list. To search the text descriptions, type in a search word for the Text field. For example, to locate members having include information for data queue APIs, type "data queue" in the Text field and press Enter.

Once you have located the appropriate member, use the "/COPY" RPG compiler directive to have the compiler copy the contents of the member into your program (COBOL programmers use the COPY statement).

-----------------------------------
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
iSeries administrator tips
Application modernization in the i world
Checking on System i disk space requires creating a new command: XRTVSYSSTS
High availability planning and testing for iSeries: Notes, gloats, and moats
Viewing netstat information
Step-by-step PTF download determination
Preventing adopted special privileges on i5/OS
Display documents on your iSeries -- quick and easy
System i modularization: How-to tips -- part 4
System i printing: Configuring an ASCII printer
System i modularization -- part 3

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts