1 / 31

Application Development on Power System (IBM i )

Application Development on Power System (IBM i). Application Development on Power System (IBM i ). School of Software Engineering Tongji University HUANGJie. Syllabus. 2014/9/21. 2. Unit 1 Power System Foundation. Chapter 4 Message Management. Outline. Agenda:

adli
Download Presentation

Application Development on Power System (IBM i )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Application Development on Power System (IBM i) Application Development on Power System (IBM i) School of Software Engineering Tongji University HUANGJie

  2. Syllabus 2014/9/21 2

  3. Unit 1 Power System Foundation Chapter 4 Message Management

  4. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  5. Identifying characteristics of messages and message queues • Messages provide the means of communication between the system and its users. For example, • When you ask the system to do something, the system might respond with messages indicating the status of your request. • You can also communicate with other users through messages that are sent via the system. • Each application program can have a set of messages to communication with the user. • Message sources • System, the system generates messages, such as when you attempt to perform operations that can not be performed. • Application, applications produce messages that are specifically concerned with the application program. • User, any message that comes from another user of the system, including the system operator, is a user message. • You can think of messages as mail sent from one point in system i to another.

  6. Identifying characteristics of messages and message queues(2) • Message types • Two common types of messages are sent on the system i. • Informational messages 通告消息 • Inquiry messages 查询消息 • Informational Message • Informational messages don’t require a reply from the receiver. For example, the informational messages from a batch job run in last night. • The system operator often send informational messages to warn users of system shutdown. For example, when you need to load and apply new PTFs from IBM, you must shut down the system, therefore you need to notify users what you are about to do so that they can sign off. • Inquiry Message • Inquiry message request a reply. • Messages are sent to either the system operator message queue(QSYSOPR), a user message queue, or the workstation message queue. Also users may send you messages to your own message queue.

  7. Identifying characteristics of messages and message queues(3) • Message queues • A message queue is similar to a mailbox messages. It receives and holds messages for you that you display when you want. • Message queues are assigned to users or workstations. • Each user has a message queue with the same name as the user profile name(or user ID). When a user signs on to the system for the first time, the system automatically creates a user message queue. • A system operator who uses the user profile QSYSOPR has a message queue named QSYSOPR. The QBATCH subsystem usually sends all system operation messages to this message queue. When the system is configured for the first time, the system operator queue is created. • Each workstation has a message queue with the same name as the workstation device name. A workstation name is shown on the sign-on screen when you sign on the system. When a workstation is connected to the first time, the system automatically creates a workstation message queue.

  8. Identifying characteristics of messages and message queues(4) • Message tips, • Messages remain in a message queue until someone deletes them. Since messages take up space on the system, it is important to clean up message queues periodically. • During an interactive session, messages sent from other users and messages sent by system are usually places in the interactive user’s message queue.

  9. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  10. Sending messages • Send messages, do one of the following: • Follow a menu path • On the system I Main menu, type 3, General system tasks, and press Enter. • On the General system tasks menu, type 4, messages, and press Enter. • On the messages menu, type 1, send a message, and press Enter. • Take a fast path to the MESSAGE menu by entering the command GO MESSAGE • Interrupt your current job, start an alternative interactive session • If you are using a PC with 5250 display session emulation, you might need to use an alternative method to access the system request line. For example, • right-click the mouse to display a keypad and click the SysRq button. • Press Enter on the system request entry line to display the System Request menu. • Type 5, send a message, and press Enter. • Type the SNDMSG command and press F4, the send message (SNDMSG) display appears.

  11. Sending messages (2) • Sending informational messages to users • You would simply type the message, specify the user who should receive the message, and press Enter. • Tip: • To send a message to all sign-on users, type *ALLACT in the to user profile field. • Sending informational messages to workstations • Command: SNDMSG • Press: F10, to see the additional parameters display • For the To message queue parameter, specify the name of the workstation device where you want to send message. • You can specify the name of any message queue to send a message to. • However, the To user profile and To message queue parameters are mutually exclusive, only one of these parameters can be used per message.

  12. Sending messages (3) • Sending inquiry messages • Command: SNDMSG • Press F10, to see the additional parameters display • For the message type parameter, specify *INQ. • Note: when sending an inquiry message, you can send to only one user or workstation at a time. By default, the reply comes back to the message queue of the workstation sending the message. • Sending break messages to workstations • Command: SNDBRKMSG • Press F4 • A break message appears on a workstation screen as soon as it is received. It does not get stored in a message queue. Because break message are immediately displayed, they can only be sent to workstation message queues. • A system operator often send break messages. For example, he need the immediate attention of users to inform them of critical system events(such as system shut down), or have a specific request for them(such as sign off), send a break message.

  13. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  14. Displaying messages • Messages can be displayed using either basic or intermediate assistance level. One of the following methods: • Command: DSPMSG • Follow a menu path: • On the system I Main menu, type 3, General system tasks, and press Enter. • On the General system tasks menu, type 4, messages, and press Enter. • On the messages menu, type 3, display messages and press Enter. • Note: • The default value *WRKUSR for the message queue parameter means that messages are shown from your workstation’s message queue if there are any messages on it. • Therefore, if you accept the default values and press Enter, your workstation message queue display is shown, as long as you have messages. • When you press Enter on that display, messages are shown from your(user profile)message queue. If there are no messages on the workstation’s message queue, only the messages from the user profile message queue are shown. • Tip: • To directly access your workstation or user message queue, just type either DSPMSG or WRKMSG and press Enter.

  15. Displaying messages(2) • Replying to Inquiry Messages: • All inquiry messages, including break messages that interrupt a user, provide a reply line after the message. Just type your reply on this line and press Enter. The answer is sent back to the source of the message. You can also always reply at a later time. • Displaying messages using basic and intermediate assistance levels • System I provides different assistant helps. There are three assistance levels • Basic • Intermediate • Advanced • Intermediate level uses the displays that support all of the tasks that can be done on system i. this assistance level allows very complex tasks to be performed with greater flexibility. • Example: • From display message screen, Press F24 to see more function keys. • Press F21 to select the assistance level. 1=Basic,2=Intermediate • Can you see the difference between these two level displays?

  16. Displaying messages(3) • Displaying system operator messages • If you don’t sign-on as QSYSOPR, you can still display messages in the QSYSOPR message queue by doing one of the following: • Press F6 on the work with messages display using basic assistance level • Type DSPMSG QSYSOPR or WRKMSG QSYSOPR on any command line. You can optionally specify the ASTLVL keyword with a value of *BASIC or *INTERMED. • Select 3 on the general system tasks menu. • Select 4 on the messages menu. • Select 6 on the system request menu • Select other menus from which you can display system operator messages, such as the TECHHELP and MANAGESYS menus. • Note: a system request interrupts your current job to start an alternative interactive session. • For comparison purposes, you can try display messages in intermediate assistance level.

  17. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  18. Removing messages • Removing individual messages • To removing a single message using the intermediate assistance level, follow these steps: • Position the cursor anywhere on the message you want to delete. • Press F11 (remove a message). • To removing a single message using the basic assistance level, follow these steps: • On the option line next to the message you want to delete, type 4 (remove). • Press Enter. • On the confirm remove of message display, press Enter. • Removing all messages in a queue • To remove all messages, using the intermediate assistance level, press F13(remove all). • Removing all messages not needing a reply • To remove all messages except those that haven’t been answered, press F16. this works like F13, except any answered inquiry or sender copy messages in the message queue are saved. • The use of F16 is available at both the basic and intermediate assistance level.

  19. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  20. Handling system and error messages • You are sure to receive a variety of system messages that indicate conditions ranging from simple typing errors to problems with system devices or programs. You might receive any one of the following: • An error message on your current display. • A message regarding a system problem that is sent to the system operator message queue. • A message regarding a potentially severe system condition that is sent to the system operator message queue and other message queues specified by the user. • One of the first things you want to do when you encounter a system or error message that you don’t know is to get more information about it. • Getting Help on a message • To obtain additional information about help, complete the following steps, • Place the cursor anywhere on the message, press F1 (Help). • Usually, one of the cause listed helps you identify the problem. However, be aware that the suggested solutions might not correct the problem. The listed causes are only probable reasons why the error is getting triggered.

  21. Handling system and error messages (2) • Message ID • Message ID is in the upper-left corner of display. This message indicates the message category. For example, • CPA-CPZ: messages from the operating system • CBE-CBX: COBOL messages • QRG: RPG language messages • SQL: Structure Query Language messages • The system message file is QCPFMSG. For example, • To display all messages descriptions in QCPFMSG, enter the command DSPMSGD *ALL. • To work with all message descriptions in QCPFMSG, enter the command WRKMSGD. • Severity codes 严重性代码 • Message severity codes are associated with different system message types. Codes are made up of two digits, ranging from 00 to 99. the higher the value, the more severe the condition. • To get a list of the message types associated with severity codes, following these steps, • Place the cursor on the severity field. • Press F1. • Press Enter on the hypertext phrase “Message severity codes”. • The range of severity codes is generally categorized into those three levels. • Information messages • Warning messages • Severe or termination messages

  22. Handling system and error messages (3) • Other types of messages • You can also get help on an error message that appears at the bottom of a menu or other display, or on a program error message. • Position the cursor on the message and press F1, the additional message information display appears in all cases. • If you press Enter on a reply message without typing a reply, the system uses a default reply. • Replying to system and error messages • Message reply choices are typically one-character codes. The choices are displayed within parentheses at the end of the message and explained in the recovery section on the additional message information display. • After paging through the cause and recovery for a message and determining what action to take, type your reply on the line provided, and press Enter. • Printing messages • To print a single message, press F6(print) on the additional message information display. This prints all the information about the message. The output is sent to a spooled file, and the output can be viewed or printed from the output queue. • Occasionally, when problem resolution becomes lengthy, printing out the sequence of error messages is one of the best things you can do to help resolve it. Rather than print each individual message, you can easily print the entire message queue. For example, • DSPMSG MSGQ(*SYSOPR) OUTPUT(*PRINT) • To access the spooled file containing the messages, enter this command: • WRKPLF

  23. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  24. Displaying message queue attributes • F22 • This function key shows all attributes of the message queue. • The main attributes include Delivery, Program, Severity fields. • Delivery • Delivery refers to the method by which messages are transferred. As a operator, you will frequently need to change the delivery mode. Common delivery values are as follows, • *NOTIFY: when you receive a message, your work is not interrupted. You are notified that a message has arrived by the workstation message waiting light and an alarm(if your workstation as one) that sound. You can use either the display message command or work with message command to see the message. • *BREAK: when you receive a message, your work is interrupted, and a separate message display containing the message is shown. This value can be overridden if a program has been specified to handle the message. For example, the *BREAK value can be used when you, as the system operator, need to shut down the system. The ‘shut down’ message interrupts all interactive users and allows them to close their jobs and sign off. • *HOLD: you are not notified when a new message arrives. The message queue retains the messages until you request them using DSPMSG or WRKMSG command. This is the default delivery value for the QSYSOPR message queue.

  25. Outline • Agenda: • Identifying characteristics of messages and message queues • Sending messages • Display messages • Removing messages • Handling system and error messages • Displaying message queue attributes • Changing message queues

  26. Changing message queues • You can change the way a message queue notifies you of messages, change the message queue severity level, change the break-handling program, and more. • To change message queue attributes, type the command CHGMSGQ and press F4. • Any changes you make to a message queue are reflected the next time that message is delivered. • For example, changing Delivery from *NOTIFY to *BREAK for your message queue forces your work to be interrupted every time a message is sent to you. Press F10 to see additional parameters for this display. • Tip: • To work with all workstation and user message queues, just type the command WRKMSGQ *ALL. The work with message queues display allows you to create, change, delete, and clear message queues. • Be aware that several restrictions apply to the options available on the work with message queues display. For example, you need certain authorities to clear (remove) messages in a message queue.

  27. Summary • 消息管理是System I 最重要的通信手段。 • 工作站、用户、系统程序及应用程序之间的通信都是通过消息机制来实现的。 • 在System i系统中,消息总是被送到消息队列中等候处理,直到用户处理完毕将消息删除。有了消息队列,即使用户不在系统上工作,消息也不会丢失,也不必对到来的消息做即刻处理。 • 消息队列是OS/400的一种对象(*MSGQ),有三种建立方式: • 当创建一个用户描述(*USRPRF)时,系统会自动为该用户建立一个相应的消息队列。 • 在配置工作站设备(workstation device),为该设备创建一个设备描述(*DEVD)时,系统会为该工作站设备建立一个相应的消息队列。 • 用户也可以用CRTMSGQ建立其他的消息队列。 • 系统还为系统操作员提供一个消息队列—QSYSOPR。这是一个重要的消息队列。在系统发生异常、或对设备进行某种操作、或发生一些较重要事件时,都会将消息发送到此消息队列中。 • 对消息的处理决定于消息队列的一个属性值—交付模式(Delivery Mode)。 • *BREAK:超过Severity级别的消息到达时,中断用户的工作,显示该消息。 • *NOTIFY:超过Severity级别的消息到达时,不中断用户的工作,但是要给用户一个提示。 • *HOLD:所有消息到达该队列时,都不做任何提示。 • *DFT:到达的消息不存放在消息队列中(QSYSOPR除外),如果是需要回答的消息,系统用缺省值自动回答。这种设置会丢失消息。

  28. Summary (续) • 使用CHGMSGQ命令,用户可随时根据需要修改相应消息队列的Delivery Mode和Severity值。 • 当用户退出(Sign off)时,系统会自动将该用户消息队列的Delivery Mode修改成*HOLD。当用户再次登陆时,系统又会将该消息队列的Delivery Mode设置成*NOTIFY,这样如果用户在脱机的时间内有消息到达就会给用户一个提示。 • 用户可以用DSPMSG命令查看消息队列的消息,对需要回答的消息在应答线上输入回答信息。消息处理完毕后,可用相应的选项(OPTION)或功能键将其删除,但是只有获得该消息队列的作业才允许做消息删除操作。消息队列任何时候只能被分配给一个作业。 • 发送消息的常用命令有两个:SNDMSG和SNDBRKMSG。他们的区别在于SNDBRKMSG发出的消息只能送到工作站消息队列中,且不受消息队列的Delivery Mode制约,消息到达对方后,马上在工作站上显示出来。 • 每个作业也有一个作业消息队列(JOB message queue),用于接受外来的请求和返回请求执行的结果。这个消息队列由一个外部请求者通信用的消息队列(*EXT)和一组作业中程序间进行通信用的程序消息队列组成。送到作业消息队列中的消息有些会在工作站上显示出来,有些会写到JOB LOG中。

  29. References • IBM red books • URL: http://www.ibm.com/ • Materials of this course (PPTs or PDFs) • \\10.60.38.2\Publicfiles\CourseDocuments_课程文档\IBMSystemi_Application_Course_黄杰 • Books for Unit One • 《走入IBM 小型机世界》(电子工业出版社) • 《Unix & Linux 大学教程》(清华大学出版社) • 《IBM i:AS/400重装上阵-操作、管理与开发》(电子工业出版社) • 《银湖计划》(华夏出版社) • 《罗彻斯特城堡》(中信出版社)

  30. References • Reference: • Publication: • IBM i5 and iSeries System Handbook (GA195486) • Web Sites: • iSeries Information Center • http://publib.boulder.ibm.com/eserver/ • Support • http://www.ibm.com/systems/support/i/ • Redbook • http://www.redbooks.ibm.com/

  31. Questions?

More Related