IBM Support

Write Your First Mainframe App Part 4 Using ISPF - Create an ISPF Message

How To


Summary

Use the ISPF editor to create a message by using Edit Models and display the message by using ISPF Dialog Test.

Steps

In 'Write Your First Mainframe App Using ISPF - Part 1 What is ISPF?'  we introduced basic ISPF concepts.  In 'Write Your First Mainframe App Using ISPF - Part 2 What Data Sets Do You Need?'  you allocated the data sets for your application. In 'Write Your First Mainframe App Using ISPF - Part 3 Create a Panel', you created a panel that displays “Hello World”.

Another way that ISPF can say “hello, world!” is in a message.

You already have a messages library that you allocated in part 2. Now you can use the ISPF editor to create a message. From the ISPF Primary Option Menu, type 2 on the command line and press enter to see the ISPF Edit Entry panel.

If you allocated your messages library with a 3-part name, you can enter it in the Project, Group, and Type fields. In the member field, enter the name of the message member. Message member names are 1 - 5 characters followed by 2 numbers.  In this case, call the message member HELLO00.

ISPF Edit entry panel for message member HELLO00

Press Enter to start an edit session. On the command line, type PROFILE. Change any values that are not appropriate for messages, as you did in part 3 for panels. Make sure

  • NUM OFF
  • CAPS OFF
  • HI AUTO.

Type RESET on the command line to remove the profile lines from the display.

On the command line, type MODEL to see an example of the syntax an ISPF message.

ISPF Edit model for message syntax

As with the panels model, the message model inserted the correct syntax into the editor.  The green text shows how a message looks in the editor (The numbers on the left side are the line command area and not part of the data.)  The blue text consists of notes to tell what each part of the message is. Notes disappear when the member is saved.

Message members usually have many different messages. Each message starts with the member name, followed by 1 or 2-digit suffix.  For example, in a member called HELLO00, the first message can be called HELLO000. HELLO000 is called the message ID. The next messages in the member might be called HELLO001, HELLO002, and HELLO003.

In this case, replace message ID MSGX990 with HELLO000.

The text within the quotes is the 24 characters of the short message.  Because we want a long message without a short message, blank out the characters between the quotes on the first line. Since the message is informational, not an error, set

.TYPE=NOTIFY

Press the F11 key to scroll to the right to erase the rest of the parameters on the first line.

Press the F10 key to return to the left side of the member. Type the long message between the quotes on the second line.  Remove the + at the end of the line. The + indicates that the message is continued on the next line. Use the D line command to delete the last line of the message. Type RESET on the command line and press Enter to remove the notes.

ISPF Edit session with the HELLO00 message member

Press F3 or enter the End command to save the message and return to the Edit Entry Panel.

Press F3 to return to the ISPF Primary Option Menu.

Now, you can display the message.  The easiest way to display a message is to use Dialog Test. Select Option 7, Dialog Test, on the ISPF Primary Option Menu.

The first thing you need to do is tell ISPF where the message is located. Type 6 on the Option field of the Dialog Test Primary Option Panel.

The LIBDEF service associates an ISPF DDname with an ISPF library. The DDname for the message library is ISPMLIB, so on the Invoke Dialog Service panel, enter the LIBDEF command like this, substituting your message library name for the one in the example:

ISPF Dialog Test LIBDEF command for messages

When you press enter, DDname ISPMLIB is associated with the data set indicated by the ID parameter. Press the End key to return to the Dialog Test Primary Option Panel. To display the message, type 2 in the Option field and press Enter. On the Display Panel panel, type in the name of the message, and press Enter.

ISPF Dialog Test panel to display message HELLO000

Now you see message HELLO000 displayed in a long message pop-up field.

image-20220824125127-1

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSBLLD","label":"ISPF for z\/OS"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
30 November 2022

UID

ibm16615089