Application Program AS400

  • View
    527

  • Download
    20

Embed Size (px)

Text of Application Program AS400

AS/400 Advanced Series

IBM

Application Display ProgrammingVersion 4

SC41-5715-00

AS/400 Advanced Series

IBM

Application Display ProgrammingVersion 4

SC41-5715-00

Take Note! Before using this information and the product it supports, be sure to read the general information under Notices on page xxix.

First Edition (August 1997)This edition applies to the licensed program IBM Operating System/400 (Program 5769-SS1), Version 4 Release 1 Modification 0, and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure that you are using the proper edition for the level of the product. Order publications through your IBM representative or the IBM branch serving your locality. If you live in the United States, Puerto Rico, or Guam, you can order publications through the IBM Software Manufacturing Solutions at 800+879-2755. Publications are not stocked at the address given below. IBM welcomes your comments. A form for readers comments may be provided at the back of this publication. You can also mail your comments to the following address: IBM Corporation Attention Department 542 IDCLERK 3605 Highway 52 N Rochester, MN 55901-7829 USA or you can fax your comments to: United States and Canada: 800+937-3430 Other countries: (+1)+507+253-5192 If you have access to Internet, you can send your comments electronically to IDCLERK@RCHVMW2.VNET.IBM.COM; IBMMAIL, to IBMMAIL(USIB56RZ). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Copyright International Business Machines Corporation 1997. All rights reserved. Note to U.S. Government Users Documentation related to restricted rights Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.

ContentsNotices . . . . . . . . . . . . . . . Programming Interface Information Trademarks . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxix xxx xxx xxxi xxxi xxxi xxxi xxxiii

About Application Display Programming (SC41-5715) Who Should Use This Book . . . . . . . . . . . . . . . . . Prerequisite and Related Information . . . . . . . . . . . Information Available on the World Wide Web . . . . . .

Summary of Changes to Application Display Programming

Part 1. Building a Sample Display with Online Help InformationChapter 1. Building a Sample Display with Online Help Information. . .

1-1

Part 2. Programming Application Displays Using Display FilesChapter 2. Defining Your Display in a Display File . . . . . . . . . . . . . Establishing a Display File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Determining File Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . Deciding Whether to Describe Data Inside or Outside Your Program . . . Creating a Display File and Description . . . . . . . . . . . . . . . . . . . . Changing the File Description . . . . . . . . . . . . . . . . . . . . . . . . . . Detecting File Description Changes . . . . . . . . . . . . . . . . . . . . . . . Defining Display Fields and Functions in a Record Format . . . . . . . . . . . Understanding the Field Attribute Characters . . . . . . . . . . . . . . . . . Understanding How Record Format Fields Can Be Used . . . . . . . . . . Defining Function Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Command Attention (CAnn) and Command Function (CFnn) Keys Specifying Alternative Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . Passing Information via Indicators . . . . . . . . . . . . . . . . . . . . . . . Inserting Constant Field Text from a Message Description . . . . . . . . . Allowing for Right-to-Left Cursor Movement . . . . . . . . . . . . . . . . . . Defining Cursor Movement to Input-Capable Positions Only . . . . . . . . Defining Cursor Progression for Entry Fields . . . . . . . . . . . . . . . . . Defining Attributes for Entry Fields . . . . . . . . . . . . . . . . . . . . . . . Protecting Entry Fields Using Edit Masks . . . . . . . . . . . . . . . . . . . Specifying Right-to-Left Display Processing . . . . . . . . . . . . . . . . . . Specifying Word Wrap for Fields . . . . . . . . . . . . . . . . . . . . . . . . Emphasizing Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Your Own Edit Codes . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Valid Screen Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . Enabling Your Display to Be Printed . . . . . . . . . . . . . . . . . . . . . . Defining Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Program-Described Data . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Input-Only Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Output-Only Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copyright IBM Corp. 1997 .

2-1 2-1 . 2-2 . 2-3 . 2-4 . 2-5 . 2-6 . 2-7 . 2-8 . 2-9 2-11 2-12 2-13 2-14 2-16 2-16 2-16 2-17 2-18 2-19 2-19 2-20 2-21 2-22 2-23 2-23 2-24 2-25 2-27 2-27 2-28 2-28.

iii

Defining Input and Output Files

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2-28 3-1 3-1 . 3-2 . 3-2 . 3-3 . 3-3 . 3-4 . 3-4 . 3-5 . 3-5 3-30 3-31 3-33 3-40 3-41 3-41 3-43 3-45 3-45 3-49 3-49 3-49 3-50 3-51 3-51 3-52 4-1 . 4-1 . 4-3 4-10 4-12 4-12 4-15 4-15 4-16 4-17 4-19 4-21 4-22 4-23 4-24 4-24 4-24 4-27 4-27 4-31 5-1 5-2 5-2

Chapter 3. Working with Display Files in an Application . . . . . . . Understanding How the System Allocates Resources . . . . . . . . . . . . Opening Display Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Acquiring a Display Station for I/O Operations . . . . . . . . . . . . . . . . Obtaining Information about Display Files and Display Stations . . . . . . Obtaining Information about Open and I/O Operations . . . . . . . . . . Obtaining Attribute Information about Display Stations . . . . . . . . . . Sending and Receiving Data . . . . . . . . . . . . . . . . . . . . . . . . . . Determining Which Record Formats Are Active on a Display . . . . . . Writing Output to the Display . . . . . . . . . . . . . . . . . . . . . . . . Inviting Input to the Display . . . . . . . . . . . . . . . . . . . . . . . . . Reading Invited Input from the Display . . . . . . . . . . . . . . . . . . . Reading Input from the Display . . . . . . . . . . . . . . . . . . . . . . . Writing Output and Reading Input at the Same Time . . . . . . . . . . Canceling Input That Was Not Waited For . . . . . . . . . . . . . . . . . Locking the Keyboard and Positioning the Cursor During I/O Operations Saving Previously Displayed Information . . . . . . . . . . . . . . . . . . Understanding the Effects of I/O Operations on Command Keys . . . . Avoiding Record Format Problems on the 5250 Display Station . . . . Releasing an Acquired Display Station from I/O Operations . . . . . . . . Closing Display Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping Display Operations to High-Level Language Operations . . . . . Sharing Display Files in the Same Job . . . . . . . . . . . . . . . . . . . . Understanding the Open Operation for Files Shared in a Job . . . . . . Understanding the Input/Output Operation for Files Shared in a Job . Understanding the Close Operation for Files Shared in a Job . . . . . Chapter 4. Displaying Groups of Records Using Subfiles . . . . . Recognizing Subfile Uses . . . . . . . . . . . . . . . . . . . . . . . . . . Describing Subfiles in Your DDS Source . . . . . . . . . . . . . . . . . Using a Subfile in a Program . . . . . . . . . . . . . . . . . . . . . . . . Requesting I/O Operations for a Subfile . . . . . . . . . . . . . . . . . . Requesting I/O Operations for a Subfile Record Format . . . . . . . Requesting I/O Operations for a Subfile Control Record Format . . Recognizing Subfile I/O Requests in High-Level Languages . . . . Controlling the Appearance of Subfiles . . . . . . . . . . . . . . . . . . Displaying Horizontal Subfiles with Display Modes . . . . . . . . . . . Specifying Subfile Size Equal to Page Size . . . . . . . . . . . . . . . . Specifying Subfile Size Not Equal to Page Size . . . . . . . . . . . . . Checking Validity on Subfile Data . . . . . . . . . . . . . . . . . . . . . Displaying Error Messages from Subfiles . . . . . . . . . . . . . . . . . Positioning the Cursor on the Displayed Subfile . . . . . . . . . . . . . Positioning the Cursor Initially . . . . . . . . . . . . . . . . . . . . . . Positioning the Cursor When a Roll Key Is Used . . . . . . . . . . . Positioning the Cursor When a Fold or Truncate Key Is Used . . . Positioning the Cursor and Rolling When Two or More Records Are Displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Understanding Subfile DDS and Program LogicExample . . . . . . . Chapter 5. Defining Windows with Display Files Window Terminology . . . . . . . . . . . . . . . . . . DDS Window Keywords . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .