Kednos PL/I for OpenVMS Systems Reference Manual
 *HyperReader
  Next     Previous     Contents     Examples     Figures     Tables     Index     Close     Help  
CONTENTS

  Title Page

  Copyright Page

  Preface

  1      Program Structure and Content
    1.1 Lexical Elements
      1.1.1      Keywords
      1.1.2      Punctuation
      1.1.3      Identifiers
      1.1.4      Comments
    1.2 Statements
      1.2.1      Statement Formats
      1.2.2      Statement Labels
      1.2.3      Simple Statements
      1.2.4      Compound Statements
      1.2.5      Summary of Statements by Function
    1.3 Program Format
    1.4 Blocks
      1.4.1      Begin Blocks
      1.4.2      Procedure Blocks
      1.4.3      Containment
      1.4.4      Block Activation
      1.4.5      Relationship of Block Activations
      1.4.6      Block Termination
    1.5 Data and Variables
      1.5.1      Preprocessor

  2      Declarations
    2.1 DECLARE Statement
      2.1.1      Simple Declarations
      2.1.2      Declarations Outside Procedures
      2.1.3      Multiple Simple Declarations
      2.1.4      Factored Simple Declarations
      2.1.5      Array Declarations
      2.1.6      Structure Declarations
    2.2 Attributes
      2.2.1      ALIGNED Attribute
      2.2.2      ANY Attribute
      2.2.3      AREA Attribute
      2.2.4      AUTOMATIC Attribute
      2.2.5      BASED Attribute
      2.2.6      BINARY Attribute
      2.2.7      BIT Attribute
      2.2.8      BUILTIN Attribute
      2.2.9      CHARACTER Attribute
      2.2.10     CONDITION Attribute
      2.2.11     CONTROLLED Attribute
      2.2.12     DECIMAL Attribute
      2.2.13     DEFINED Attribute
      2.2.14     DESCRIPTOR Attribute
      2.2.15     DIMENSION Attribute
      2.2.16     DIRECT Attribute
      2.2.17     ENTRY Attribute
      2.2.18     ENVIRONMENT Attribute
      2.2.19     EXTERNAL Attribute
      2.2.20     FILE Attribute
      2.2.21     FIXED Attribute
      2.2.22     FLOAT Attribute
      2.2.23     GLOBALDEF Attribute
      2.2.24     GLOBALREF Attribute
      2.2.25     INITIAL Attribute
      2.2.26     INPUT Attribute
      2.2.27     INTERNAL Attribute
      2.2.28     KEYED Attribute
      2.2.29     LABEL Attribute
      2.2.30     LIKE Attribute
      2.2.31     LIST Attribute
      2.2.32     MEMBER Attribute
      2.2.33     NONVARYING Attribute
      2.2.34     OFFSET Attribute
      2.2.35     OPTIONAL Attribute
      2.2.36     OUTPUT Attribute
      2.2.37     PARAMETER Attribute
      2.2.38     PICTURE Attribute
      2.2.39     POINTER Attribute
      2.2.40     POSITION Attribute
      2.2.41     PRECISION Attribute
      2.2.42     PRINT Attribute
      2.2.43     READONLY Attribute
      2.2.44     RECORD Attribute
      2.2.45     REFER Attribute
      2.2.46     REFERENCE Attribute
      2.2.47     RETURNS Attribute
      2.2.48     SEQUENTIAL Attribute
      2.2.49     STATIC Attribute
      2.2.50     STREAM Attribute
      2.2.51     STRUCTURE Attribute
      2.2.52     TYPE Attribute
      2.2.53     TRUNCATE Attribute
      2.2.54     UNALIGNED Attribute
      2.2.55     UNION Attribute
      2.2.56     UPDATE Attribute
      2.2.57     VALUE Attribute
      2.2.58     VARIABLE Attribute
      2.2.59     VARYING Attribute

  3      Data Types
    3.1 Summary of Data Types
      3.1.1      Declarations
      3.1.2      Default Attributes
        3.1.2.1      Attributes of Constants
        3.1.2.2      Arithmetic Operands
      3.1.3      Compatible Data Types
    3.2 Arithmetic Data
      3.2.1      Precision and Scale of Arithmetic Data Types
      3.2.2      Fixed-Point Binary Data
        3.2.2.1      Internal Representation of Fixed-Point Binary Data
      3.2.3      Fixed-Point Decimal Data
        3.2.3.1      Fixed-Point Decimal Constants
        3.2.3.2      Fixed-Point Decimal Variables
        3.2.3.3      Use in Expressions
        3.2.3.4      Internal Representation of Fixed-Point Decimal Data
      3.2.4      Floating-Point Data
        3.2.4.1      Floating-Point Constants
        3.2.4.2      Floating-Point Variables
        3.2.4.3      Using Floating-Point Data in Expressions
        3.2.4.4      Floating-Point Data Formats
        3.2.4.5      OpenVMS VAX Internal Representation of Floating-Point Data
        3.2.4.6      OpenVMS Alpha Internal Representation of Floating-Point Data
      3.2.5      Pictured Data
        3.2.5.1      Picture Characters
        3.2.5.2      Assigning Values to Pictured Variables
        3.2.5.3      Extracting Values from Pictured Data
        3.2.5.4      Editing by Picture
        3.2.5.5      The Internal Representation of Pictured Variables
    3.3 Character-String Data
      3.3.1      Character-String Constants
        3.3.1.1      Replication of String Constants
      3.3.2      Character-String Variables
        3.3.2.1      Fixed-Length Character-String Variables
        3.3.2.2      Internal Representation of Fixed-Length Character Data
        3.3.2.3      Varying-Length Character-String Variables
        3.3.2.4      Internal Representation of Varying Character Data
      3.3.3      Alignment of Character Strings
    3.4 Bit-String Data
      3.4.1      Bit-String Constants
        3.4.1.1      Replication Factor for Bit-String Constants
      3.4.2      Bit-String Variables
      3.4.3      Alignment of Bit-String Data
      3.4.4      Internal Representation of Bit Data
      3.4.5      Bit Strings and Integers
    3.5 Pointer Data
      3.5.1      Pointer Variables in Expressions
      3.5.2      Internal Representation of Pointer Data
    3.6 Offset Data
    3.7 Label Data
      3.7.1      Label Array Constants
      3.7.2      Label Values
      3.7.3      Label Variables
      3.7.4      Internal Representation of Variable Label Data
    3.8 Entry Data
      3.8.1      Entry Constants
      3.8.2      Entry Values
      3.8.3      Entry Variables
      3.8.4      Internal Representation of Variable Entry Data
    3.9 File Data
      3.9.1      File Constants
      3.9.2      File Values
      3.9.3      File Variables
    3.10 Area Data
      3.10.1     Area Variables in Expressions
      3.10.2     Reading and Writing Areas
      3.10.3     Internal Representation of Area Data
    3.11 Condition Data

  4      Aggregates
    4.1 Arrays
      4.1.1      Array Declarations
      4.1.2      References to Individual Elements
      4.1.3      Initializing Arrays
      4.1.4      Assigning Values to Array Variables
      4.1.5      Order of Assignment and Output for Multidimensional Arrays
        4.1.5.1      Using GET and PUT Statements with Array Variables
      4.1.6      Passing Arrays as Arguments
      4.1.7      Built-In Functions Providing Array Dimension Information
    4.2 Structures
      4.2.1      Structure Declarations and Attributes
      4.2.2      Using The UNION Attribute On Structure Declarations
      4.2.3      Initializing Structures
      4.2.4      Using Structure Variables in Expressions
      4.2.5      Passing Structure Variables as Arguments
      4.2.6      Member Attributes
        4.2.6.1      Using the TYPE Attribute
        4.2.6.2      Using the LIKE Attribute
        4.2.6.3      Using the REFER Option
      4.2.7      Structure-Qualified References
    4.3 Arrays of Structures
      4.3.1      Arrays of Structures that Contain Arrays
      4.3.2      Connected and Unconnected Arrays
    4.4 Internal Representation of Aggregate Data

  5      Storage Classes
    5.1 Automatic Variables
    5.2 Static Variables
    5.3 Internal Variables
    5.4 External Variables
    5.5 Based Variables
      5.5.1      Data Types Used with Based Variables
      5.5.2      Allocation in Areas
      5.5.3      Referring to Based Variables
      5.5.4      Based Variables and Dynamic Storage Allocation
      5.5.5      Using the ADDR Built-in Function
      5.5.6      Data-Type Matching for Based Variables
        5.5.6.1      Matching by Overlay Defining
        5.5.6.2      Matching by Left-to-Right Equivalence
        5.5.6.3      Nonmatching Based Variable References
      5.5.7      Examples of Based Variables
    5.6 Controlled Variables
      5.6.1      Using the ALLOCATION Built-In Function
      5.6.2      Using the ADDR Built-In Function
    5.7 Dynamically Allocated Variables
      5.7.1      ALLOCATE Statement
      5.7.2      FREE Statement
      5.7.3      Other Mechanisms for Dynamic Storage Allocation
    5.8 Defined Variables
      5.8.1      String Overlay Defining
      5.8.2      Rules for Overlay Defining
    5.9 Storage Sharing

  6      Expressions and Data Type Conversions
    6.1 Assignment Statement
    6.2 Operators and Operands
      6.2.1      Arithmetic Operators
      6.2.2      Logical Operators
        6.2.2.1      NOT
        6.2.2.2      AND
        6.2.2.3      OR
        6.2.2.4      EXCLUSIVE OR
        6.2.2.5      AND THEN
        6.2.2.6      OR ELSE
      6.2.3      Relational Operators
        6.2.3.1      Arithmetic Comparisons
        6.2.3.2      Bit-String Comparisons
        6.2.3.3      Character-String Comparisons
        6.2.3.4      Comparing Noncomputational Data
      6.2.4      Concatenation Operator
    6.3 Precedence of Operators and Expression Evaluation
    6.4 Data Type Conversion of Operands and Expressions
      6.4.1      Contexts in which PL/I Converts Data
      6.4.2      Derived Data Types for Arithmetic Operations
      6.4.3      Conversion of Operands in Nonarithmetic Operations
      6.4.4      Built-In Conversion Functions
      6.4.5      Implicit Conversion During Assignment
      6.4.6      Assignment to Arithmetic Variables
        6.4.6.1      Arithmetic to Arithmetic Conversions
          6.4.6.1.1       Conversions to Fixed Point
          6.4.6.1.2       Conversions to Floating Point
          6.4.6.1.3       Conversions from FIXED BINARY to Other Data Types
        6.4.6.2      Pictured to Arithmetic Conversions
        6.4.6.3      Bit-String to Arithmetic Conversions
        6.4.6.4      Character-String to Arithmetic Conversions
      6.4.7      Assignments to Bit-String Variables
        6.4.7.1      Arithmetic to Bit-String Assignments
        6.4.7.2      Pictured to Bit-String Conversions
        6.4.7.3      Character-String to Bit-String Conversions
      6.4.8      Assignments to Character-String Variables
        6.4.8.1      Arithmetic to Character-String Conversions
          6.4.8.1.1       Conversion from Fixed-Point Binary or Fixed-Point Decimal
          6.4.8.1.2       Conversion from Floating-Point Binary or Floating-Point Decimal
        6.4.8.2      Pictured to Character-String Conversion
        6.4.8.3      Bit-String to Character-String Conversion
      6.4.9      Assignments to Pictured Variables
      6.4.10     Conversions Between Offsets and Pointers

  7      Procedures
    7.1 PROCEDURE Statement
    7.2 Functions and Function References
    7.3 ENTRY Statement
      7.3.1      Specifying Entry Points
      7.3.2      Multiple Entry Points
    7.4 CALL Statement
    7.5 Parameters and Arguments
      7.5.1      Rules for Specifying Parameters
      7.5.2      Argument Passing
    7.6 Calling External and Internal Procedures
    7.7 Terminating Procedures
    7.8 Passing Arguments to Non-PL/I Procedures
      7.8.1      Passing Arguments by Immediate Value
      7.8.2      Passing Arguments by Reference
      7.8.3      Passing Arguments by Descriptor

  8      Program Control
    8.1 DO Groups and Statements
      8.1.1      Simple DO
      8.1.2      DO WHILE
      8.1.3      DO UNTIL
      8.1.4      Controlled DO
      8.1.5      DO REPEAT
    8.2 BEGIN Statement
    8.3 END Statement
    8.4 IF Statement
      8.4.1      Nested IF Statements
    8.5 SELECT Statement
      8.5.1      The Two Forms of the SELECT Statement
      8.5.2      OTHERWISE Clause
      8.5.3      Nested SELECT Statements
    8.6 GOTO Statement
    8.7 LEAVE Statement
    8.8 STOP Statement
    8.9 Null Statement
    8.10 Condition Handling
      8.10.1     ON Statement
      8.10.2     SIGNAL Statement
      8.10.3     REVERT Statement
      8.10.4     Summary of ON Conditions
        8.10.4.1     ANYCONDITION Condition Name
        8.10.4.2     AREA Condition Name
        8.10.4.3     CONDITION Condition Name
        8.10.4.4     CONVERSION Condition Name
        8.10.4.5     ENDFILE Condition Name
        8.10.4.6     ENDPAGE Condition Name
        8.10.4.7     ERROR Condition Name
        8.10.4.8     FINISH Condition Name
        8.10.4.9     FIXEDOVERFLOW Condition Name
        8.10.4.10    KEY Condition Name
        8.10.4.11    OVERFLOW Condition Name
        8.10.4.12    STORAGE Condition Name
        8.10.4.13    STRINGRANGE Condition Name
        8.10.4.14    SUBSCRIPTRANGE Condition Name
        8.10.4.15    UNDEFINEDFILE Condition Name
        8.10.4.16    UNDERFLOW Condition Name (Kednos PL/I for OpenVMS VAX only)
        8.10.4.17    VAXCONDITION Condition Name
        8.10.4.18    ZERODIVIDE Condition Name
      8.10.5     Default PL/I ON-Unit
      8.10.6     Establishment of ON-Units
      8.10.7     Contents of an ON-Unit
      8.10.8     Search Path for ON-Units
      8.10.9     Completion of ON-Units

  9      Input and Output
    9.1 Opening and Closing Files
      9.1.1      File Declarations
      9.1.2      File Variables
      9.1.3      Opening a File
        9.1.3.1      OPEN Statement Options
        9.1.3.2      Effects of Opening a File
        9.1.3.3      Establishing the File's Attributes
        9.1.3.4      Determining the File Specification
        9.1.3.5      Accessing an Existing File
        9.1.3.6      Creating a File
        9.1.3.7      File Positioning
      9.1.4      File Description Attributes and Options
      9.1.5      Closing a File
    9.2 Stream I/O
      9.2.1      Processing and Positioning of Stream Files
      9.2.2      Input by the GET Statement
        9.2.2.1      Syntax Summary of the GET Statement
        9.2.2.2      GET EDIT
        9.2.2.3      GET LIST
        9.2.2.4      GET SKIP
        9.2.2.5      Execution of the GET Statement
      9.2.3      Output by the PUT Statement
        9.2.3.1      Syntax Summary of the PUT Statement
        9.2.3.2      PUT EDIT
        9.2.3.3      PUT LINE
        9.2.3.4      PUT LIST
        9.2.3.5      PUT PAGE
        9.2.3.6      PUT SKIP
        9.2.3.7      Execution of the PUT Statement
      9.2.4      Format Items
        9.2.4.1      A Format Item
        9.2.4.2      B Format Items
        9.2.4.3      COLUMN Format item
        9.2.4.4      E Format Item
        9.2.4.5      F Format Item
        9.2.4.6      LINE Format Item
        9.2.4.7      P Format Item
        9.2.4.8      PAGE Format Item
        9.2.4.9      R Format Item
        9.2.4.10     SKIP Format Item
        9.2.4.11     TAB Format Item
        9.2.4.12     X Format Item
        9.2.4.13     Format Specifications
      9.2.5      Processing and Positioning of Character Strings
      9.2.6      Terminal I/O
        9.2.6.1      Simple Input from a Terminal
        9.2.6.2      Simple Output to a Terminal
        9.2.6.3      Print File
    9.3 Record I/O
      9.3.1      READ Statement
        9.3.1.1      File Positioning Following a READ Statement
      9.3.2      WRITE Statement
        9.3.2.1      File Positioning Following a WRITE Statement
      9.3.3      DELETE Statement
        9.3.3.1      File Positioning Following a DELETE Statement
      9.3.4      REWRITE Statement
        9.3.4.1      File Positioning Following a REWRITE Statement
      9.3.5      Position Information for a Record File

  10     Preprocessor
    10.1 Preprocessor Compilation Control
    10.2 Preprocessor Statements
      10.2.1     %Assignment Statement
      10.2.2     %Null
      10.2.3     %ACTIVATE
      10.2.4     %DEACTIVATE
      10.2.5     %DECLARE
      10.2.6     %DICTIONARY
      10.2.7     %DO
      10.2.8     %END
      10.2.9     %ERROR
      10.2.10    %FATAL
      10.2.11    %GOTO
      10.2.12    %IF
      10.2.13    %INCLUDE
      10.2.14    %INFORM
      10.2.15    %LIST_xxx
      10.2.16    %NOLIST_xxx
      10.2.17    %PAGE
      10.2.18    %PROCEDURE
      10.2.19    %REPLACE Statement
      10.2.20    %RETURN Statement
      10.2.21    %SBTTL
      10.2.22    %TITLE
      10.2.23    %WARN
    10.3 User-Generated Diagnostic Messages
    10.4 Preprocessor Built-In Functions

  11     Built-In Functions, Subroutines, and Pseudovariables
    11.1 Built-In Function Arguments
    11.2 Conditions Signaled
    11.3 Summary of Built-In Functions
    11.4 Descriptions of Built-In Functions
      11.4.1     ABS
      11.4.2     ACOS
      11.4.3     ACTUALCOUNT
      11.4.4     ADD
      11.4.5     ADDR
      11.4.6     ADDREL
      11.4.7     ALLOCATION
      11.4.8     ASIN
      11.4.9     ATAN
      11.4.10    ATAND
      11.4.11    ATANH
      11.4.12    BINARY
      11.4.13    BIT
      11.4.14    BOOL
      11.4.15    BYTE
      11.4.16    BYTESIZE
      11.4.17    CEIL
      11.4.18    CHARACTER
      11.4.19    COLLATE
      11.4.20    COPY
      11.4.21    COS
      11.4.22    COSD
      11.4.23    COSH
      11.4.24    DATE
      11.4.25    DATETIME
      11.4.26    DECIMAL
      11.4.27    DECODE
      11.4.28    DESCRIPTOR
      11.4.29    DIMENSION
      11.4.30    DIVIDE
      11.4.31    EMPTY
      11.4.32    ENCODE
      11.4.33    ERROR
      11.4.34    EVERY
      11.4.35    EXP
      11.4.36    FIXED
      11.4.37    FLOAT
      11.4.38    FLOOR
      11.4.39    HBOUND
      11.4.40    HIGH
      11.4.41    INDEX
      11.4.42    INFORM
      11.4.43    INT
      11.4.44    LBOUND
      11.4.45    LENGTH
      11.4.46    LINE
      11.4.47    LINENO
      11.4.48    LOG
      11.4.49    LOG10
      11.4.50    LOG2
      11.4.51    LOW
      11.4.52    LTRIM
      11.4.53    MAX
      11.4.54    MAXLENGTH
      11.4.55    MIN
      11.4.56    MOD
      11.4.57    MULTIPLY
      11.4.58    NULL
      11.4.59    OFFSET
      11.4.60    ONARGSLIST
      11.4.61    ONCHAR
      11.4.62    ONCODE
      11.4.63    ONFILE
      11.4.64    ONKEY
      11.4.65    ONSOURCE
      11.4.66    PAGENO
      11.4.67    POINTER
      11.4.68    POSINT
      11.4.69    PRESENT
      11.4.70    PROD
      11.4.71    RANK
      11.4.72    REFERENCE
      11.4.73    REVERSE
      11.4.74    ROUND
      11.4.75    RTRIM
      11.4.76    SEARCH
      11.4.77    SIGN
      11.4.78    SIN
      11.4.79    SIND
      11.4.80    SINH
      11.4.81    SIZE
      11.4.82    SOME
      11.4.83    SQRT
      11.4.84    STRING
      11.4.85    SUBSTR
      11.4.86    SUBTRACT
      11.4.87    SUM
      11.4.88    TAN
      11.4.89    TAND
      11.4.90    TANH
      11.4.91    TIME
      11.4.92    TRANSLATE
      11.4.93    TRIM
      11.4.94    TRUNC
      11.4.95    UNSPEC
      11.4.96    VALID
      11.4.97    VALUE
      11.4.98    VARIANT
      11.4.99    VERIFY
      11.4.100  WARN
    11.5 Built-In Subroutines
    11.6 Pseudovariables
      11.6.1     INT Pseudovariable
      11.6.2     ONCHAR Pseudovariable
      11.6.3     ONSOURCE Pseudovariable
      11.6.4     PAGENO Pseudovariable
      11.6.5     POSINT Pseudovariable
      11.6.6     STRING Pseudovariable
      11.6.7     SUBSTR Pseudovariable
      11.6.8     UNSPEC Pseudovariable

  A Alphabetic Summary of Keywords

  B Digital Multinational Character Set

  C Compatibility with PL/I Standards
    C.1 Differences and Similarities Between Kednos PL/I for OpenVMS VAX and Kednos PL/I for OpenVMS Alpha
    C.2 Relation to the 1981 PL/I General-Purpose Subset
      C.2.1      Program Structure
      C.2.2      Program Control
      C.2.3      Storage Control
      C.2.4      Input/Output
      C.2.5      Attributes and Pictures
      C.2.6      Built-In Functions and Pseudovariables
      C.2.7      Expressions
    C.3 198x PL/I General-Purpose Subset Features Supported
      C.3.1      Lexical Constructs
      C.3.2      Program Control
      C.3.3      Storage Control
      C.3.4      Input/Output
      C.3.5      Attributes and Pictures
      C.3.6      Program Control
      C.3.7      Built-In Functions and Pseudovariables
      C.3.8      Expressions
    C.4 Full PL/I Features Supported
      C.4.1      Program Structure
      C.4.2      Program Control
      C.4.3      Storage Control
      C.4.4      Attributes and Pictures
      C.4.5      Built-In Functions and Pseudovariables
      C.4.6      Expressions
    C.5 Nonstandard Features from Other Implementations
      C.5.1      Preprocessor
      C.5.2      Built-In Functions
      C.5.3      LIKE Extension
      C.5.4      Declarations
    C.6 PL/I-Specific Extensions for OpenVMS VAX and OpenVMS Alpha Platforms
      C.6.1      Procedure-Calling and Condition-Handling Extensions
      C.6.2      Support of OpenVMS Record Management Services
      C.6.3      Miscellaneous Extensions
    C.7 Implementation-Defined Values and Features

  D Migration Notes
    D.1 Keywords Not Supported
    D.2 Differences Between Kednos PL/I for OpenVMS VAX and Kednos PL/I for OpenVMS Alpha
    D.3 Implicit Conversions
    D.4 Printing a Hexadecimal Memory Dump

  E Language Summary
    E.1 Statements
    E.2 Attributes
    E.3 Expressions and Data Conversions
    E.4 Pseudovariables
    E.5 Built-In Subroutines

  Next     Previous     Contents     Examples     Figures     Tables     Index     Close     Help     ~Off