Automatic language selection

If you choose not to set the language explicitly, the editor can automatically determine the language of the file being edited. The language is determined by looking at the first nonblank string in the file. In cases where ambiguity exists between languages, as in the case of C and JCL (where both may start with //) and in the case of PL/I and REXX (where both may start with a /* comment), the last qualifier of the data set name may be used to determine the language. The rules for automatic language recognition are as follows:
Assembler
Asterisk in column 1 or a recognized opcode of CSECT, DSECT, MACRO, TITLE, START or COPY.
Note: *PROCESS starting in column 1 is recognized as PL/I.
BookMaster®
First character is . or : in column 1.
C
Any of these:
  • First string is #
  • First string is // and last qualifier of the data set name is not .CNTL, .JCL, or .ISPCTLx
  • First string is /* and last qualifier of the data set name is .C
COBOL
First nonblank is a * or / in column 7.
HTML
First nonblank character is <, and the first tag in the file that is not a comment is either a <!DOCTYPE HTML> tag or a <?HTML> tag.
ISPF DTL
First nonblank character is <, and the file is not identified as an HTML or XML file.
ISPF Panel
First string is ) in column 1, followed by a panel section name, or the first string is % in column 1.
ISPF Skeleton
) in column 1 in a file that does not seem to be a panel.
JCL
Any of these:
  • //anything followed by the word COMMAND, DD, ELSE, ELSEIF, EXEC, IF, INCLUDE, JCLLIB, JOB, OUTPUT, PROC, SET, XMIT, or any word beginning with the characters 'MSG'
  • //* in column 1
  • // in column 1, and the last qualifier of the data set name is .CNTL, .JCL, or ISPCTLx
  • Any of these starting in column 1:
    *$
    /*JOBPARM
    /*MESSAGE
    /*NETACCT
    /*NOTIFY
    /*OUTPUT
    /*PRIORITY
    /*ROUTE
    /*SETUP
    /*SIGNOFF
    /*SIGNON
    /*XEQ
    /*XMIT
Pascal
First string is (*, or the first string is /* and the last qualifier of the data set name is .PASCAL.
PL/I
First string is % or /* or the first string is *PROCESS starting in column 1. The use of carriage control characters in column one may cause PL/I detection to fail. When the last qualifier of the data set name starts with "PL", automatic language detection is retried ignoring column one if the first nonblank characters occur in column one, and no language can be detected. See REXX, C, and Panel for more information.
REXX
First string is a /* comment containing REXX, or the first string is a /* comment, and the last qualifier of the data set name is .EXEC or .REXX.
SuperC
Either of these starting in column 3 or 4:
  • ISRSUPC -
  • ASMFSUPC -
XML
First nonblank character is <, and the first tag in the file that is not a comment is either a <!DOCTYPE XML> tag or a <?XML> tag.
Other
First word is PROC, CONTROL, ISPEXEC, or ISREDIT.

HILITE AUTO selects a language based on the first nonblank line, and in some cases, the last qualifier of the data set name.

ISPF only scans up to the first 72 bytes in each line to determine the language. If the data that would identify the language is past the 72nd column, the language may be determined incorrectly.