ContentsIndexPreviousNext

FREE phrase on ACCEPT statement

The ACUCOBOL-GT compiler in its HP e3000 compatibility mode supports the following HP e3000 COBOL formats of the ACCEPT statement.


Note: Format 10, Format 11, and Format 12 are the numbers given to the ACCEPT statement formats. ACUCOBOL-GT formats of the ACCEPT statement are documented in the "Procedure Division Statements" section of Chapter 6 of Book 3, Reference Manual.

Format 10 (HP e3000 COBOL)

ACCEPT identifier [FREE]  [FROM { SYSIN         }]
                                { CONSOLE       }
                                { mnemonic-name }

Format 11 (HP e3000 COBOL)

ACCEPT identifier FREE  [FROM { SYSIN         }]
                              { CONSOLE       }
                              { mnemonic-name }

[ON INPUT ERROR imperative-statement-1]
[NOT ON INPUT ERROR imperative-statement-2]

[END-ACCEPT]

Format 12 (HP e3000 COBOL)

ACCEPT identifier FROM { DATE        }
                       { DAY         }
                       { DAY-OF-WEEK }
                       { TIME        }

Syntax Rules

identifier is a data item that receives the accepted data.

mnemonic-name is a user-defined word declared in Special-Names that refers to a display device, or is the name of a display device. See the entry for ACCEPT in Book 3, Reference Guide, section 6.6, "Procedure Division Statements."

imperative-statement-1 and imperative-statement-2 are COBOL statements. The INPUT ERROR phrase in which the statement appears can be used only if the FREE phrase is used." (see General Rule 3.)

General Rules

1. CONSOLE and SYSIN are system devices. See Book 3, Reference Manual, section 4.2.3, "Special-Names Paragraph."

2. The FREE phrase allows the use of the free-field format. The free-field format allows you to continue the input into the next line when the input field is smaller than the defined length of identifier. In this format, the ampersand character ("&") acts as a continuation character when it is the last non-blank character in the input line, thus allowing the input to be continued in the next line. The pound sign ("#") acts as as a line terminator (but is not required when the input comes from the terminal). To specify the "#" character and circumvent its use as a line terminator, use two "#" characters in succession.

3. The ON INPUT ERROR and NOT ON INPUT ERROR phrases can be used only with the FREE statement. They allow the handling of the following input error conditions:

  • An illegal character in a numeric item.

  • Too many digits in a numeric item.

    An input string that is too long for the receiving field.