Leaning how to use the GOBACK command in the imperative, procedural COBOL language, AcuCOBOL.
Give me an example use of the GOBACK command in AcuCOBOL
AcuCOBOL is an imperative, procedural COBOL language. The GOBACK
command is used for program flow control. It returns the program control to the main block.
For example:
cobol Copy code
PERFORM Test-Block
GOBACK
Test-Block.
DISPLAY "This is a test block"
END-PERFORM
In the above example, the PERFORM
command will jump to the Test-Block section of the code. Once the end of the Test-Block
is hit, the GOBACK
command will send control back to the PERFORM
statement after the Test-Block
code block. This allows the code to repeat the code in the Test-Block
block every time the GOBACK
command is called.