IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. AUTHOR. Michael Coughlan. *> https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program PROCEDURE DIVISION. DISPLAY 'Hello world!'. DISPLAY 'https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program'. DISPLAY 'How to compile and run a cobol program'. DISPLAY 'cobc -free -x -o helloworld helloworld.cbl'. DISPLAY './helloworld'. DISPLAY 'https://www.tutorialspoint.com/cobol/'. STOP RUN.
(You must do it in the terminal. Either local or remote with SSH)
exec('cobc -free -x -o helloworld helloworld.cbl', $output1, $retval1);
Array ( )
exec('files/helloworld', $output2, $retval2);Array
(
[0] => Hello world!
[1] => https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program
[2] => How to compile and run a cobol program
[3] => cobc -free -x -o helloworld helloworld.cbl
[4] => ./helloworld
[5] => https://www.tutorialspoint.com/cobol/
)
str_replace("\n", '<br />', shell_exec('./helloworld') )
Hello world!
https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program
How to compile and run a cobol program
cobc -free -x -o helloworld helloworld.cbl
./helloworld
https://www.tutorialspoint.com/cobol/