Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp
Title: OS/400 CL Programming V4R5
Document Number: SC41-5721-03
Build Date: 10/14/99 09:13:28 Build Version: 1.3.0
Document Path: /home/webapps/epubs/htdocs/book/

CONTENTS Table of Contents


COVER         Book Cover 

NOTICES       Notices 

EDITION       Edition Notice 

CONTENTS      Table of Contents 

FIGURES       Figures 

PREFACE       About CL Programming (SC41-5721) 
PREFACE.1     Who should read this book 
PREFACE.2     AS/400 Operations Navigator 
  PREFACE.2.1   Installing Operations Navigator 
PREFACE.3     Prerequisite and related information 
PREFACE.4     How to send your comments 

FRONT_1       Summary of Changes 
FRONT_1.1     Changes since SC41-5721-02 

1.0           Chapter 1.  Introduction 
1.1           Control Language 
  1.1.1         Procedure 
  1.1.2         Module 
  1.1.3         Program 
  1.1.4         Service Program 
  1.1.5         Command Syntax 
1.2           CL Procedures 
1.3           Command Definition 
1.4           Menus 
1.5           Objects and Libraries 
  1.5.1         Objects 
  1.5.2         Libraries 
1.6           Messages 
  1.6.1         Message Descriptions 
  1.6.2         Message Queues 
1.7           Testing Functions 

2.0           Chapter 2.  CL Programming 
2.1           Creating a CL Program 
  2.1.1         Interactive Entry 
  2.1.2         Batch Entry 
  2.1.3         Parts of a CL Procedure 
  2.1.4          Example of a Simple CL Program 
2.2           Commands Used in CL Procedures 
  2.2.1         Commands Entered on the RQSDTA and CMD Parameters 
  2.2.2         CL Commands 
2.3           Using CL Procedures 
2.4           Working with Variables 
  2.4.1         Declaring a Variable 
  2.4.2         Using Variables to Specify a List or Qualified Name 
  2.4.3         Lowercase Characters in Variables 
  2.4.4         Variables Replacing Reserved or Numeric Parameter Values 
  2.4.5         Changing the Value of a Variable 
  2.4.6         Trailing Blanks on Command Parameters 
  2.4.7         Writing Comments in CL Procedures 
2.5           Controlling Processing within a CL Procedure 
  2.5.1         Using the GOTO Command and Labels 
  2.5.2         Using the IF Command 
  2.5.3         Using the DO Command and DO Groups 
  2.5.4         Using the ELSE Command 
  2.5.5         Using Embedded IF Commands 
  2.5.6         Using the *AND, *OR, and *NOT Operators 
  2.5.7         Using the %BINARY Built-In Function 
  2.5.8         Using the %SUBSTRING Built-In Function 
  2.5.9         Using the %SWITCH Built-In Function 
  2.5.10        Using the Monitor Message (MONMSG) Command 
2.6           Values That Can Be Used as Variables 
  2.6.1         Retrieving System Values 
  2.6.2         Retrieving Configuration Source 
  2.6.3         Retrieving Configuration Status 
  2.6.4         Retrieving Network Attributes 
  2.6.5         Retrieving Job Attributes 
  2.6.6         Retrieving Object Descriptions 
  2.6.7         Retrieving User Profile Attributes 
  2.6.8         Retrieving Member Description Information 
2.7           Working with CL Procedures 
  2.7.1         Logging CL Procedure Commands 
  2.7.2         CL Module Compiler Lists 
  2.7.3         Errors Encountered during Compilation 
  2.7.4         Obtaining a Procedure Dump 
  2.7.5         Displaying Module Attributes 
  2.7.6         Displaying Program Attributes 
  2.7.7         Return Code Summary 
2.8           Compiling Source Programs for a Previous Release 
  2.8.1         Previous-Release (*PRV) Libraries 
  2.8.2         Installing CL Compiler Support for a Previous Release 

3.0           Chapter 3.  Controlling Flow and Communicating between Programs and Procedures 
3.1           CALL Command 
3.2           CALLPRC Command 
3.3           RETURN Command 
3.4           Passing Parameters between Programs and Procedures 
  3.4.1         Using the CALL Command 
  3.4.2         Common Errors When Calling Programs and Procedures 
3.5           Using Data Queues to Communicate between Programs and Procedures 
  3.5.1         Remote Data Queues 
  3.5.2         Comparisons with Using Database Files as Queues 
  3.5.3         Similarities to Message Queues 
  3.5.4         Prerequisites for Using Data Queues 
  3.5.5         Managing the Storage Used by a Data Queue 
  3.5.6         Allocating Data Queues 
  3.5.7         Examples Using a Data Queue 
  3.5.8         Creating Data Queues Associated with an Output Queue 
  3.5.9         Sample Data Queue Entry 
3.6           Using Data Areas to Communicate between Procedures and Programs 
  3.6.1         Local Data Area 
  3.6.2         Group Data Area 
  3.6.3         Program Initialization Parameter (PIP) Data Area 
  3.6.4         Remote Data Areas 
  3.6.5         Creating a Data Area 
  3.6.6         Data Area Locking and Allocation 
  3.6.7         Displaying a Data Area 
  3.6.8         Changing a Data Area 
  3.6.9         Retrieving a Data Area 
  3.6.10        Retrieve Data Area Examples 
  3.6.11        Changing and Retrieving a Data Area Example 

4.0           Chapter 4.  Objects and Libraries 
4.1           Object Types and Common Attributes 
4.2           Functions Performed on Objects 
  4.2.1         Functions the System Performs Automatically 
  4.2.2         Functions You Can Perform Using Commands 
4.3           Libraries 
  4.3.1         Library Lists 
  4.3.2         Displaying a Library List 
  4.3.3         Using Generic Object Names 
  4.3.4         Searching for Multiple Objects or a Single Object 
4.4           Using Libraries 
  4.4.1         Creating a Library 
  4.4.2         Specifying Authority for Libraries 
  4.4.3         Security Considerations for Objects 
  4.4.4         Default Public Authority for Newly Created Objects 
  4.4.5         Default Auditing Attribute for Newly Created Objects 
  4.4.6         Placing Objects in Libraries 
  4.4.7         Deleting and Clearing Libraries 
  4.4.8         Displaying Library Names and Contents 
  4.4.9         Displaying and Retrieving Library Descriptions 
4.5           OS/400 National Language Support 
4.6           Describing Objects 
4.7           Displaying Object Descriptions 
4.8           Retrieving Object Descriptions 
  4.8.1         RTVOBJD Example 
4.9           Creation Information for Objects 
4.10          Detecting Unused Objects on the System 
4.11          Moving Objects from One Library to Another 
4.12          Creating Duplicate Objects 
4.13          Renaming Objects 
4.14          Compressing or Decompressing Objects 
  4.14.1        Compression of Objects 
  4.14.2        Temporarily Decompressed Objects 
  4.14.3        Automatic Decompression of Objects 
4.15          Deleting Objects 
4.16          Allocating Resources 
  4.16.1        Displaying the Lock States for Objects 

5.0           Chapter 5.  Working with Objects in CL Procedures and Programs 
5.1           Accessing Objects in CL Programs 
  5.1.1         Exceptions: Accessing Command Definitions, Files, and Procedures. 
  5.1.2         Checking for the Existence of an Object 
5.2           Working with Files in CL Procedures 
  5.2.1         Referring to Files in a CL Procedure 
  5.2.2         Opening and Closing Files in a CL Procedure 
  5.2.3         Declaring a File 
  5.2.4         Sending and Receiving Data with a Display File 
  5.2.5         Writing a CL Program to Control a Menu 
  5.2.6         Overriding Display Files in a CL Procedure 
  5.2.7         Working with Multiple Device Display Files 
  5.2.8         Receiving Data from a Database File 
  5.2.9         Overriding Database Files in a CL Procedure or Program 
  5.2.10        Referring to Output Files from Display Commands 

6.0           Chapter 6.  Advanced Programming Topics 
6.1           Using the QCAPCMD Program 
6.2           Using the QCMDEXC Program 
  6.2.1         Using the QCMDEXC Program with DBCS Data 
6.3           Using the QCMDCHK Program 
6.4           Using Message Subfiles in a CL Program or Procedure 
6.5           Allowing User Changes to CL Commands at Run Time 
  6.5.1         Using the Prompter within a CL Procedure or Program 
  6.5.2         Selective Prompting for CL Commands 
  6.5.3         QCMDEXC with Prompting in CL Procedures and Programs 
6.6           Using the Programmer Menu 
  6.6.1         Uses of the Start Programmer Menu (STRPGMMNU) Command 
6.7           Command Analyzer Exit Points 
6.8           Application Programming for DBCS Data 
  6.8.1         Designing DBCS Application Programs 
  6.8.2         Converting Alphanumeric Programs to Process DBCS Data 
6.9           Using DBCS Data in a CL Program 
6.10          Sample CL Programs 
  6.10.1        Initial Program for Setup (Programmer) 
  6.10.2        Moving an Object from a Test Library to a Production Library (Programmer) 
  6.10.3        Saving Specific Objects in an Application (System Operator) 
  6.10.4        Recovery from Abnormal End (System Operator) 
  6.10.5        Submitting a Job (System Operator) 
  6.10.6        Timing Out While Waiting for Input from a Device Display 
  6.10.7        Retrieving Program Attributes 
6.11          Loading and Running an Application from Tapes or Diskettes 
  6.11.1        Responsibilities of the Application Writer 

7.0           Chapter 7.  Defining Messages 
7.1           Creating a Message File 
  7.1.1         Determining the Size of a Message File 
7.2           Adding Messages to a File 
  7.2.1         Assigning a Message Identifier 
  7.2.2         Defining Messages and Message Help 
  7.2.3         Assigning a Severity Code 
  7.2.4         Defining Substitution Variables 
  7.2.5         Specifying Validity Checking for Replies 
  7.2.6         Sending an Immediate Message and Handling a Reply 
  7.2.7         Defining Default Values for Replies 
  7.2.8         Specifying Default Message Handling for Escape Messages 
  7.2.9         Example of Describing a Message 
  7.2.10        Defining Double-Byte Messages 
7.3           System Message File Searches 
  7.3.1         Searching for a Message File 
  7.3.2         Overriding Message Files 
7.4           Types of Message Queues 
  7.4.1         Creating or Changing a Message Queue 
  7.4.2         Job Message Queues 

8.0           Chapter 8.  Working with Messages 
8.1           Sending Messages to a System User 
8.2           Sending Messages from a CL Program 
  8.2.1         Messages 
  8.2.2         Examples of Sending Messages 
  8.2.3         Call Stack Entry Identification on SNDPGMMSG 
  8.2.4         Receiving Messages in a CL Procedure or Program 
  8.2.5         Retrieving Messages in a CL Procedure 
  8.2.6         Removing Messages from a Message Queue 
8.3           Monitoring for Messages in a CL Program or Procedure 
  8.3.1         Default Handling 
  8.3.2         Notify Messages 
  8.3.3         Status Messages 
  8.3.4         Preventing the Display of Status Messages 
8.4           Break-Handling Programs 
8.5           QSYSMSG Message Queue 
  8.5.1         Messages Sent to QSYSMSG Message Queue 
  8.5.2         Sample Program to Receive Messages from QSYSMSG 
8.6           Using the System Reply List 
8.7           Message Logging 
  8.7.1         Job Log 
  8.7.2         QHST History Log 
  8.7.3         Format of the History Log 
  8.7.4         Processing the QHST File 
  8.7.5         QHST Job Start and Completion Messages 
  8.7.6         Deleting QHST Files 

9.0           Chapter 9.  Defining Commands 
9.1           Overview of How to Define Commands 
  9.1.1         Step Description 
  9.1.2         Authority Needed for the Commands You Define 
  9.1.3         Example of Creating a Command 
9.2           How to Define Commands 
  9.2.1         Using the CMD Statement 
  9.2.2         Defining Parameters 
9.3           Data Type and Parameter Restrictions 
9.4           Defining Lists for Parameters 
  9.4.1         Defining a Simple List 
  9.4.2         Defining a Mixed List 
  9.4.3         Defining Lists within Lists 
  9.4.4         Defining a Qualified Name 
  9.4.5         Defining a Dependent Relationship 
  9.4.6         Possible Choices and Values 
9.5           Using Prompt Control 
  9.5.1         Conditional Prompting 
  9.5.2         Additional Parameters 
9.6           Using Key Parameters and a Prompt Override Program 
  9.6.1         Procedure for Using Prompt Override Programs 
  9.6.2         CL Sample for Using the Prompt Override Program 
9.7           Creating Commands 
  9.7.1         Command Definition Source Listing 
  9.7.2         Errors Encountered when Processing Command Definition Statements 
9.8           Displaying a Command Definition 
9.9           Effect of Changing the Command Definition of a Command in a Procedure or Program 
  9.9.1         Changing Command Defaults 
9.10          Writing a Command Processing Program or Procedure 
  9.10.1        Writing a CL or HLL Command Processing Program 
  9.10.2        Writing a REXX Command Processing Procedure 
9.11          Writing a Validity Checking Program 
9.12          Examples of Defining and Creating Commands 
  9.12.1        Calling Application Programs 
  9.12.2        Substituting a Default Value 
  9.12.3        Displaying an Output Queue 
  9.12.4        Displaying Messages from IBM Commands More Than Once 
  9.12.5        Creating Abbreviated Commands 
  9.12.6        Deleting Files and Source Members 
  9.12.7        Deleting Program Objects 

10.0          Chapter 10.  Debugging ILE Programs 
10.1          The ILE Source Debugger 
10.2          Debug Commands 
10.3          Preparing a Program Object for a Debug Session 
  10.3.1        Using a Root Source View 
  10.3.2        Using a Listing View 
  10.3.3        Using a Statement View 
10.4          Starting the ILE Source Debugger 
10.5          Adding Program Objects to a Debug Session 
10.6          Removing Program Objects from a Debug Session 
10.7          Viewing the Program Source 
10.8          Changing a Module Object 
  10.8.1        Changing the View of a Module Object 
  10.8.2        Setting and Removing Breakpoints 
  10.8.3         Setting and Removing Unconditional Breakpoints 
  10.8.4        Setting and Removing Conditional Breakpoints 
  10.8.5        Removing All Breakpoints 
10.9          Stepping through the Program Object 
  10.9.1        Using F10 or F22 on the Display Source Display 
  10.9.2        Using the STEP Debug Command 
  10.9.3        Step Over and Step Into 
10.10         Stepping over Program Objects 
  10.10.1       Using F10(Step) 
  10.10.2       Using the Step Over Debug Command 
10.11         Stepping into Program Objects 
  10.11.1       Using F22(Step Into) 
  10.11.2       Using the Step Into Debug Command 
10.12         Displaying Variables 
  10.12.1       Using F11(Display Variable) 
  10.12.2       Display logical variable example 
  10.12.3       Display character variable examples 
  10.12.4       Display decimal variable example 
  10.12.5       Displaying Variables as Hexadecimal Values 
10.13         Changing the Value of Variables 
  10.13.1       Change logical variable examples 
  10.13.2       Change character variable examples 
  10.13.3       Change decimal variable examples 
10.14         Attributes of a Variable Examples 
10.15         Equating a Name with a Variable, Expression, or Command 
10.16         Source Debug National Language Support for ILE CL 
  10.16.1       Working with *SOURCE View 
  10.16.2       Using COPY, SAVE, RESTORE, CRTDUPOBJ, and CHKOBJITG while Debugging 

A.0           Appendix A.  Debugging OPM Programs 
A.1           Debug Mode 
  A.1.1         Adding Programs to Debug Mode 
  A.1.2         Preventing Updates to Database Files in Production Libraries 
A.2           The Call Stack 
  A.2.1         Program Activations 
A.3           Handling Unmonitored Messages 
A.4           Breakpoints 
  A.4.1         Adding Breakpoints to Programs 
  A.4.2         Conditional Breakpoints 
  A.4.3         Removing Breakpoints from Programs 
A.5           Traces 
  A.5.1         Adding Traces to Programs 
  A.5.2         Instruction Stepping 
  A.5.3         Using Breakpoints within Traces 
  A.5.4         Removing Trace Information from the System 
  A.5.5         Removing Traces from Programs 
A.6           Display Functions 
A.7           Displaying the Values of Variables 
A.8           Changing the Values of Variables 
A.9           Using a Job to Debug Another Job 
  A.9.1         Debugging Batch Jobs Submitted to a Job Queue 
  A.9.2         Debugging Batch Jobs Not Started from Job Queues 
  A.9.3         Debugging a Running Job 
  A.9.4         Debugging Another Interactive Job 
  A.9.5         Considerations When Debugging One Job from Another Job 
A.10          Debugging at the Machine Interface Level 
A.11          Security Considerations 
  A.11.1        Using COPY, SAVE, RESTORE, CRTDUPOBJ, and CHKOBJITG while Debugging 

B.0           Appendix B.  TFRCTL Command 
B.1           Using the TFRCTL Command 
B.2           Passing Parameters 

C.0           Appendix C.  Job Log Output Files 
C.1           Directing a Job Log 
C.2           Model for the Primary Job Log 

D.0           Appendix D.  IBM-Supplied Libraries in Licensed Programs (LP) 
D.1           IBM-Supplied Libraries for the OS/400 Licensed Program 
  D.1.1         IBM-Supplied Libraries for Other AS/400 Licensed Programs 

E.0           Appendix E.  Abbreviations of CL Commands and Keywords 
E.1           CL Command Verb Abbreviations 
E.2           CL Command Abbreviations 
E.3           CL Command Keyword Abbreviations 

F.0           Appendix F.  Notices 
F.1           Programming Interface Information 
F.2           Trademarks 

BIBLIOGRAPHY  Bibliography 

INDEX         Index 

BACK_1        Communicating Your Comments to IBM 

COMMENTS      Readers' Comments -- We'd Like to Hear from You 

Previous Topic Next Topic Copyright IBM Corp. 1997, 2000

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.