This document provides an intermediate-level guide to DCL (Digital Command Language) programming, expanding on basic concepts. It covers advanced functions and operations crucial for developing robust DCL procedures.
Key topics include:
- Review of Basic DCL: Commands, internal and external verbs, user-defined "foreign" commands, conditional statements (IF-THEN, IF-THEN-ELSE-ENDIF), and logical controls (GOTO, GOSUB).
- Advanced Internal Subroutines: Using SUBROUTINE-ENDSUBROUTINE with CALL for parameter passing, distinguishing it from GOSUB.
- File Operations: Comprehensive coverage of File I/O using OPEN, READ, WRITE, and CLOSE statements, including details on qualifiers for error handling and sharing. It also demonstrates file search loops with the F$SEARCH lexical function and methods for handling multiple search streams.
- String Manipulation: Parsing strings with F$ELEMENT, string concatenation and reduction, substring replacement, and binary assignment. It also touches on simulating "arrays" in DCL using symbol substitution.
- Symbol Management: Detailed explanation of symbol substitution using ampersand (&) and apostrophe ('), their order of processing, and command line length limits. It also covers controlling symbol "scope" (LOCAL, GLOBAL) to manage variable visibility across procedure depths.
- Arithmetic and Logical Operations: Demonstrates integer arithmetic and boolean/logical operations (.AND., .OR., .NOT.) within DCL procedures.
- Error Trapping: Using "ON" statements (ON WARNING, ON ERROR, ON SEVERE_ERROR) and SET NOON/ON to control DCL's error handling behavior, with examples of custom error management.
- Lexical Functions: In-depth discussion and examples for various lexical functions including F$CVTIME (date/time manipulation), F$GETQUI (queue and job information), F$GETSYI (system information), F$GETDVI (device information), F$ENVIRONMENT (process environment details), F$PARSE (file specification verification and extraction), F$EXTRACT (substring extraction), F$EDIT (string modification), and F$GETJPI (process/job information).
- Process Management: Utilizing F$CONTEXT and F$PID to set selection criteria and locate specific processes on the system.
The document emphasizes practical application through examples and refers to the DCL Dictionary for comprehensive details on functions and arguments.