Upload
karen-spencer
View
219
Download
0
Embed Size (px)
Citation preview
HELLO WORLD program in COBOL - CIS12
Please use speaker notes for additional information!
Hello WorldHello World
To load MicroFocus COBOL after it has been installed on your computer, go to Programs, Personal COBOL, Personal COBOL. COBOL will load.
Hello WorldHello WorldI keyed in the lines of the program and saved it using File, Save As… The name I gave the file is hello.cbl.
This slide talks about the IDENTIFICATION DIVISION & ENVIRONMENT DIVISION.
This slide talks about the DATA DIVISION.
Hello WorldHello World
In memory, there will be a one character area called GET-ANS where the user response will be stored.
GET-ANS
Hello World
Hello World
The code for the PROCEDURE DIVISION.
Hello WorldHello World
Select Compile Program to test the program and if it is correct turn it into machine language.
Hello World - after successful compile
Hello World - after successful compile
ERROR: Command/verb DISPLAY written as DSPLAY.
Hello World - compile error
Hello World - compile error
Hello World - compile error
Hello World - compile error
Hello World - compile error
Hello World - compile error
This time I put a period after GET-ANS before the PIC X. This meant that the PIC made no sense and the GET-ANS field had a problem because it needed a PIC.
Hello World - compile error
Hello World - compile error
Hello World - compile error
Hello World - compile error
Hello World - fix compile error
Hello World - fix compile error
Error has been corrected.
Hello World - execute
Hello World - execute
Select Open for execution when you want to run your program.
Hello World - open for execution
Hello World - open for execution
Click on hello.int to select it for execution and then click OK.
Hello World - executing
Hello World - executing Hello.int is now open and shown on the screen.
Compile/Run followed by Run will execute the program.
Hello World - executing
Hello World - executing
Hello World - execute
Hello World - execute
Hello World - source program loaded
Hello World - source program loaded