User-defined Words


Any word that is defined by the developer is called as a user-defined word and is used to store the data. It can be of maximum length is 30 bytes (except for level-numbers).

Rules -

  • The user-defined word should be unique within the type to which it belongs (that might be a program, paragraph, etc.).
  • User-defined word can be duplicated at the elementary level. The reference should be used with condition-names, data-names, record-names and paragraph-names.
  • Each word atleast have one letter.

Examples -


The below list shows the examples for each type of user-defined name -

User-defined name Some Examples
Alphabet-name
SPECIAL-NAMES. 
    ALPHABET SORT-SEQ IS "A" THROUGH "Z"
                         "a" THROUGH "z".
SORT-SEQ is the alphabet-name.
Condition-name
05 STD-GENDER PIC A(06).
   88 STD-MALE VALUE "MALE".
   88 STD-FEMALE VALUE "FEMALE".
STD-MALE, STD-FEMALE are the condition-names.
Constant-name
01 WS-PI      PIC 9.99 VALUE 3.14.
WS-PI is the constant-name.
Data-item-name
05 WS-VAR     PIC X(05).
WS-VAR is the data-item-name.
File-name
FILE-CONTROL.
	SELECT INPUT-FILE ASSIGN TO DISK01.
INPUT-FILE is the file-name.
Index-name
01 BTECH-1ST-YEAR.
    03 SUBJECT-MARKS    PIC 9(03) OCCURES 6 TIMES
				INDEXED BY MARKS-INDEX.
MARKS-INDEX is the index-name.
Mnemonic-name
SPECIAL-NAMES.
    SRW IS SORT-SWITCH ON STATUS IS SORT-ON.
SRW is the mnemonic-name.
Paragraph-name
	PERFORM PARA-DISPLAY 10 TIMES.
	.
	.
PARA-DISPLAY.
	.
PARA-DISPLAY is the paragraph-name.
Program-name
PROGRAM-ID. MTHPROG1.
MTHPROG1 is the program-name.
Record-name
01 WS-REC.
	05 WS-REC-KEY PIC X(10).
	05 FIELD1     PIC X(10).
	.
	.
WS-REC is the record-name.
Routine-name
CALL ROUTINE1 USING variable-1, variable-2.
ROUTINE1 is the routine-name.
Section-name
SEC-ADDITION SECTION.
SEC-ADDITION is the section-name.
Key-name
FILE-CONTROL.
	SELECT INPUT-FILE ASSIGN TO DISK01.
		.
		.
	RECORD KEY IS WS-REC-KEY.

	01 WS-REC.
		05 WS-REC-KEY PIC X(10).
		05 FIELD1     PIC X(10).
		.
		.
WS-REC-KEY is the key-name.
Symbolic-character
SYMBOLIC CHARACTERS BACKSPACE IS 23.
BACKSPACE is the symbolic-character.
Text-name
05 WS-MTH PIC X(20) VALUE "MAINFRAMESTECHHELP".
WS-MTH is the text-name.