HP OpenVMS Systems Documentation

Content starts here

OpenVMS User's Manual


Previous Contents Index

Chapter 13
13 Introduction to Command Procedures
     13.1     Basic Information for Writing Command Procedures
         13.1.1         Default File Type
         13.1.2         Writing Commands
         13.1.3         Writing Command Lines
     13.2     Using Labels in Command Lines
         13.2.1         Labels in Local Symbol Tables
         13.2.2         Duplicate Labels
     13.3     Using Comments in Command Procedures
     13.4     How to Write Command Procedures
     13.5     Steps for Writing Command Procedures
         13.5.1         Step 1: Design the Command Procedure
         13.5.2         Step 2: Assign Variables and Test Conditionals
             13.5.2.1             Using the INQUIRE Command
             13.5.2.2             Preserving Literal Characters
             13.5.2.3             Testing Conditionals Using IF and THEN
             13.5.2.4             Writing Program Stubs
         13.5.3         Step 3: Add Loops
         13.5.4         Step 4: End the Command Procedure
             13.5.4.1             Using the EXIT Command
             13.5.4.2             Using the STOP Command
         13.5.5         Step 5: Test and Debug the Program Logic
             13.5.5.1             Debugging Command Procedures
             13.5.5.2             Enabling Verification During Execution
         13.5.6         Step 6: Add Cleanup Tasks
             13.5.6.1             Closing Files
             13.5.6.2             Deleting Temporary or Extraneous Files
             13.5.6.3             Commonly Changed Process Characteristics
             13.5.6.4             Ensuring Cleanup Operations Are Performed
         13.5.7         Step 7: Complete the Command Procedure
     13.6     Executing Command Procedures
         13.6.1         Executing Command Procedures from Within Other Command Procedures
         13.6.2         Executing Command Procedures on Remote Nodes
             13.6.2.1             Security Note
         13.6.3         Executing Command Procedures with DCL Qualifiers or Parameters
             13.6.3.1             Restrictions
         13.6.4         Executing Command Procedures Interactively
         13.6.5         Executing Command Procedures as Batch Jobs
             13.6.5.1             Remote Batch Jobs
             13.6.5.2             Restarting Batch Jobs
         13.6.6         Executing Command Procedures on Disk and Tape Volumes
             13.6.6.1             Executing on Private Disks
             13.6.6.2             Executing on Tape Volumes
     13.7     Exiting and Interrupting Command Procedures
         13.7.1         Methods of Exiting
         13.7.2         Exit-Handling Routines
     13.8     Handling Errors
         13.8.1         Default Error Actions
     13.9     Other Methods of Error Handling
         13.9.1         ON Command
     13.10     Using the SET NOON Command
     13.11     Handling Ctrl/Y Interruptions
         13.11.1         Stopping Command Procedures
         13.11.2         Stopping Privileged Images
     13.12     Setting Ctrl/Y Action Routines
         13.12.1         Using the ON Command
         13.12.2         Effects of Entering Ctrl/Y
     13.13     Disabling and Enabling Ctrl/Y Interruptions
         13.13.1         Using SET NOCONTROL=Y
         13.13.2         Using SET CONTROL=Y
     13.14     Detecting Errors in Command Procedures Using Condition Codes
         13.14.1         Displaying Condition Codes ($STATUS)
         13.14.2         Condition Codes with the EXIT Command
         13.14.3         Determining Severity Levels
         13.14.4         Testing for Successful Completion
     13.15     Using Commands That Do Not Set $STATUS
     13.16     Login Command Procedures
         13.16.1         Systemwide Login Command Procedures
         13.16.2         Personal Login Command Procedures
         13.16.3         Login Command Procedures in Captive Accounts
     13.17     Extended File Specifications and Parsing Styles
     13.18     Using Extended File Names in DCL Command Parameters
         13.18.1         Command Procedure File Specification
         13.18.2         Case Preservation and $FILE
         13.18.3         Ampersand Versus Apostrophe Substitution
Chapter 14
14 Advanced Programming with DCL
     14.1     Performing Command Procedure Input
         14.1.1         Restrictions to Including Data in Command Procedures
         14.1.2         Other Methods of Inputting Data
     14.2     Using Parameters to Pass Data
         14.2.1         Specifying Parameters as Integers
         14.2.2         Specifying Parameters as Character Strings
         14.2.3         Specifying Parameters as Symbols
         14.2.4         Specifying Parameters as Null Values
     14.3     Using Parameters to Pass Data to Batch Jobs
     14.4     Using Parameters to Pass Data to Nested Command Procedures
     14.5     Prompting for Data
     14.6     Using the SYS$INPUT Logical Name to Obtain Data
         14.6.1         Redefining SYS$INPUT as Your Terminal
         14.6.2         Defining SYS$INPUT as a Separate File
     14.7     Performing Command Procedure Output
         14.7.1         Displaying Data
         14.7.2         Redirecting Output from Commands and Images
         14.7.3         Returning Data from Command Procedures
         14.7.4         Redirecting Error Messages
             14.7.4.1             Redefining SYS$ERROR
             14.7.4.2             Suppressing System Error Messages
     14.8     Reading and Writing Files (File I/O)
     14.9     Using the OPEN Command
     14.10     Writing to Files
         14.10.1         Creating Files with Unique File Names
     14.11     Using the WRITE Command
         14.11.1         Specifying Data
         14.11.2         Using the /SYMBOL Qualifier
         14.11.3         Using the /UPDATE Qualifier
     14.12     Using the READ Command
         14.12.1         Using the /END_OF_FILE Qualifier
         14.12.2         Using the /INDEX and /KEY Qualifiers
         14.12.3         Using the /DELETE Qualifier
     14.13     Using the Close Command
     14.14     Modifying Files
         14.14.1         Updating Records
         14.14.2         Creating New Output Files
         14.14.3         Appending Records to Files
     14.15     Handling File I/O Errors
         14.15.1         Default Error Actions
     14.16     Techniques for Controlling Execution Flow
         14.16.1         Using the IF Command
         14.16.2         Using the THEN Command
         14.16.3         Using the ELSE Command
         14.16.4         Using Command Blocks
         14.16.5         Using the GOTO Command
             14.16.5.1             Avoiding Reexecution
         14.16.6         Using the GOSUB and RETURN Commands
     14.17     Creating New Command Levels
         14.17.1         Using the CALL Command
             14.17.1.1             CALL Command Defaults
             14.17.1.2             Beginning and Ending Subroutines
     14.18     Writing Case Statements
         14.18.1         Listing the Labels
         14.18.2         Writing the Case Statement
         14.18.3         Writing the Command Blocks
     14.19     Writing Loops
     14.20     Using the PIPE Command
         14.20.1         Using the PIPE Command for Conditional Command Execution
         14.20.2         Using the PIPE Command for Pipeline Execution
         14.20.3         Using the PIPE Command for Subshell Execution
         14.20.4         Using the PIPE Command for Background Execution
         14.20.5         Using the PIPE Command for Input/Output Redirection
         14.20.6         Interrupting a PIPE Command
         14.20.7         Improving Subprocess Performance


Previous Next Contents Index