Home > AS/400 Tips > iSeries administrator tips > Status messages with the CEEMOUT API -- part 2
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Status messages with the CEEMOUT API -- part 2


Ron Turull
12.20.2006
Rating: -5.00- (out of 5)


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



Ron Turull
In a recent tip, System i administrative expert Ron Turull discussed the fundamental use of the Dispatch Message (CEEMOUT) API. He also discussed its parameters and basic operations. In this tip, Ron covers the details of the API and takes a look at it in action.

In part 1 of this article, we discussed the fundamental use of the Dispatch Message (CEEMOUT) API. We also discussed its parameters and basic operations. We'll wrap it up by getting into the details of the API and looking at it in action.

You must use operational descriptors

Recall from part 1 that the CEEMOUT API accepts the following three parameters:

  • Message: A variable-length character string containing the message you want displayed.

  • Destination code: A 4-byte binary integer that controls how the system displays the message.

  • Feedback: An omissible 12-byte feedback code.

    Because the message parameter can accept different types of strings, you must specify operational descriptors on the call to the CEEMOUT API. This lets the API know the exact type of character string passed, as well as the length.

    For languages that support parameter-level descriptors (i.e., the ability to specify operational descriptors on a parameter-by-parameter basis), only the message parameter needs a descriptor.

    In RPG, operational descriptors are an all-or-nothing feature. To specify that descriptors are to be used, you must either specify the OpDesc keyword on the procedure prototype, or use the D extender on the CallB op-code. Either way, the compiler will then automatically build operational descriptors for all of the parameters that are a part of the call operation.

    Not a status message, but not a notify message either

    Messages sent with the CEEMOUT API are not true status messages. The CEEMOUT API not only displays the message at the bottom of the screen, it also logs it in the job's job log as an informational message (and, if you specify a 2 for the destination parameter, the message is only recorded in the job log – it is not displayed on the screen at all).

    This behavior is reminiscent of notify messages. Often, the program receiving a notify message (e.g., the PDM's command-line processor) will display the message on the message line and record the message in the job log. However, the system records the message in the job log as a true notify message and not an informational message as is the case when a message is sent via the CEEMOUT API.

    The bottom line is this: If you don't mind these extraneous messages in the job log, the CEEMOUT API is a great way to send "pseudo-status" messages.

    Sample code: How to use the CEEMOUT API

    This CEEMOUNT program illustrates the use of the CEEMOUT API. The program calls the API using the CallB op-code with a D extender to ensure that the compiler generates operational descriptors. The message is sent prior to entering a long operation in the program (in this case, a dummy-loop performing inane work for illustrative purposes).

    To make sending these "status" messages even easier, the sample program also defines a SndStsMsg procedure that wraps up the CEEMOUT API. The interface to the SndStsMsg procedure is simpler than the interface of the CEEMOUT API. The single parameter Msg is passed by value so you can just code a constant or literal when calling the procedure.

    Tip: Put the SndStsMsg procedure in a separate module or service program. This way, when a program needs to use it, all you need to do is link the program with the module or service program. To save yourself some more time, put the procedure prototype in a /COPY member.

    -----------------------------------
    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
    V6R1 upgrade planning checklist
    Connecting multiple iSeries systems through DDM
    Analyze the health of your IBM i server with iScore
    Researching high availability for your System i shop
    Translating Linux for IBM i admins: Using GUI to make it easy
    Translating Linux for IBM i admins: Working with jobs and networking
    OpenOffice: What to know before making the transition from Microsoft Office
    OpenOffice: An enterprise open source solution
    Database performance comparisons on IBM i
    Translating Linux for IBM i admins: User profile commands

    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.



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

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




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