Contents Acknowledgments Introduction iv xiii 1: Communicating with the System 1 The System 2 IBM i Objects 2 Subsystems 3 Types of Jobs 3 Control Language (CL) 4 System Values 5 Licensed Programs 6 User Profile 7 Sign-On 8 User Interface 10 Menu Screens 11 Prompt Entry/Command Prompt Screens 14 Using Help 17 Field or Context-Sensitive Help 17 Extended Help 18 Information Assistant 19 List or Work-With Screens 22 In Summary 24 Key Terms 25 Review Questions 26 Lab 1 27 2: Using CL 43 CL Commands 44
vi Contents Control Language Syntax 44 Command Names 44 Keyword Notation 47 Positional Notation 52 Menus of Commands 54 The GO Command 57 Library Lists 60 System Library List 60 Product Library 62 Current Library 63 User Library List 63 Objects Within Libraries 63 In Summary 64 Key Terms 65 Review Questions 65 Lab 2 66 3: Objects 81 The IBM i Object-Based Architecture 82 Types of IBM i Objects 84 Requesting an Object 86 Qualified Names 87 Library-List Commands 88 The DSPLIBL Command 88 The CHGCURLIB Command 89 The ADDLIBLE Command 91 The CHGLIBL Command 92 The EDTLIBL Command 94 Locating an Object 96 Storing Objects 98 Simplified Batch Work Management 100 Printer Spooling 101 In Summary 105 Key Terms 105 Review Questions 106 Lab 3 107 4: Handling Spooled Files 127 Printer Files 127 Printer Writer 130 Changing Writers 131
Contents vii Changing Spooled Files 132 Working with Output Queues 133 Working with Spooled Files 139 Changing Spooled File Attributes 141 Clear Output Queue 146 Assistance Levels 146 In Summary 150 Key Terms 151 Review Questions 151 Lab 4 152 5: Describing a Database File 165 File Varieties 166 Program-Described Files 167 Externally Described Files 167 Creating an Externally Described Database File 170 In Summary 202 Key Terms 203 Review Questions 204 Lab 5 204 6: Creating and Using an Externally Described Database File 213 More About SEU 213 Starting SEU 214 Using PDM to Access SEU 216 SEU Line Commands 217 Compiling the File Description 220 Create (CRT) Commands 221 The PDM Compile Option 221 Displaying an Object s Description 224 Displaying a File Description 226 Displaying Record-Format Information 227 Data File Utility 229 Using a Temporary DFU Program 231 Starting DFU on an Empty File 232 DFU Change Mode 234 Exiting DFU 235 In Summary 236 Key Terms 236 Review Questions 237 Lab 6 237
viii Contents 7: Introduction to Query 249 What Query for i5/os Does 249 Starting Query for i5/os 251 Working with Queries 252 Defining a Query 254 Selecting Files 255 Previewing a Query Layout 258 Formatting Report Columns 260 Refining Your Query 270 Selecting Sort Fields 272 Defining Report Breaks 274 Selecting and Sequencing Fields 277 More Report Column Formatting 280 Report Summary Functions 283 Defining Result Fields 284 Finishing the Report 287 Exiting Query 289 A Conceptual Foundation for Joining Files 291 Creating a Join Query 294 1=Matched Records 298 2=Matched Records with Primary File 299 3=Unmatched Records with Primary File 299 Specifying the Join Relationship 300 In Summary 305 Key Terms 306 Review Questions 306 Lab 7 307 8: Using Logical Files 327 Physical Files and Access Paths 328 Arrival-Sequence Access Paths 328 Keyed-Sequence Access Paths 329 Logical Files 333 Describing a Simple Logical File 334 Creating a Logical File 351 Specifying Access Path Maintenance 354 Using DFU on Logical Files 356 Creating Join Logical Files 357 Projection, Selection, and Access Path with Join Logical Files 361 Using Query for i5/os with a Join Logical File 363 Multiple-Format Logical Files 382
Contents ix In Summary 390 Key Terms 391 Review Questions 392 Lab 8 392 9: Additional Database Facilities 413 Creating a File (Review) 414 Changing the Source DDS 416 Preserving the Existing Data 418 Recompiling Programs and Queries That Use a Changed Physical File 434 Dealing with Based-On Logical Files 434 Using CHGPF to Modify a Physical File 437 Database File-Level Security 440 Authorization Lists 447 Group Profiles 450 In Summary 454 Key Terms 455 Review Questions 456 Lab 9 456 Additional Lab Exercise 473 10: Using IBM i Navigator 479 Introduction to IBM i Access 480 Accessing Help 483 Creating a Connection to the System 484 Basic Operations 490 Messages 490 Printer Output 497 Printers 501 Jobs 508 Work Management 512 Active Jobs 513 Job Queues 518 Output Queues 520 Subsystems 521 Databases 522 File Systems 525 In Summary 530 Key Terms 531 Review Questions 532 Lab 10 533
x Contents 11: Using Remote System Explorer 545 History 546 IBM and Eclipse 546 The IBM Rational Toolset 546 Getting Started 548 Creating a Connection 551 Library List: Add, Change, Remove Libraries 556 Creating a Source Physical File 560 Copying a Member 561 Opening and Editing a Member 563 Editing and Saving 566 Compiling 571 Debugging Overview 574 Debugging a Program 576 Running a Program 586 In Summary 588 Key Terms 588 Review Questions 589 Lab 11 590 12: Using Screen Designer and Report Designer 603 History 604 Getting Started 604 Modifying a Print File 606 Adding Records to a Print File 608 Adding Fields and Modifying Properties 610 Creating a Display Screen 613 Create the Display Screen Source Member 613 Add a Record 615 Add Keywords to a File or Record 617 Add Fields to the Record 621 Add Database Fields to a Record 624 Compile the Display 628 In Summary 630 Key Terms 631 Review Questions 631 Lab 12 632 13: Introduction to SQL 651 A Short History of SQL 652 Introduction to SQL Terms 652
Contents xi Introduction to SQL 652 Interfaces Used to Enter SQL Commands 653 Starting the Run SQL Scripts Interface 656 SQL Syntax 659 Select field-list 660 From file-list 662 Where conditional-expression 668 Some Additional SQL Capabilities 672 File Maintenance Using SQL 686 The Insert Statement 686 The Update Statement 688 The Delete Statement 692 Using SQL Assist/Prompt 694 In Summary 704 Key Terms 705 Review Questions 706 Lab 13 706 14: Using IBM i Access for Web 717 Introduction to IBM i Access for Web 718 5250 User Interface 720 Database Function 727 Print 745 Messages 746 Jobs 747 Other 748 In Summary 749 Key Terms 749 Review Questions 749 Lab 14 750 15: Introduction to DB2 Web Query for i 783 DB2 Web Query for i 784 Query for i5/os Limitations 785 DB2 Web Query Features 786 Domains 787 Users 787 Metadata 787 Getting Started with DB2 Web Query 788 DB2 Web Query Help 789 Introducing InfoAssist 793
xii Contents Getting Started with InfoAssist 794 InfoAssist Application Window Features 796 Creating the Profit Margin Inventory Report 803 Creating a Profit Margin Chart 812 Enhancing Charts 817 Creating a Compound Document 822 Summary 832 Key Terms 833 Review Questions 833 Lab 15 834 16: Getting Started with CL Programming 863 CL Review 864 CL Program Uses 866 Advantages of CL Programs 866 Creating CL Programs 867 Using RDP to Enter CL Source 868 CL Program Structure 870 Designing the Start-Up Program 872 Entering the Program 874 Declaring a File 875 Declaring Variables 876 Changing the Value of a Variable 878 Control Structures 880 Iteration Structures 884 File I/O in CL Programs 888 Sending Messages 890 Using Concatenation 896 Finishing the Start-Up Program 898 Creating a CL Program 904 In Summary 904 Key Terms 906 Review Questions 906 Lab 16 907 Lab 16 Source Listings 919 STRUPPGM Source Code 919 MARKTIME Source Code 921 Index 923