MICRO FOCUS Animator V2

From the Start Menu, select
  
         Courseware Applications option
  
         Installed Apps for CSC option
  
         COBOL option, then click
  
         Animator V2

Animator Version 2 Window
  
  This is the starting Animator screen displayed for a newfile. (Edit+Execute:<newfile>) Note that the cursor is initially positioned in Area A [column 8]. Begin typing your program code at that point.

Edit+Execute:<newfile> Window
  
If this is a new file, then name it and save it to a diskette using the option on the File menu, Save current file as.
  
Then click on the CHECK MARK button to start the Checker (compiler).
  
After compiling your program (with no errors), click the RUNNER button or select Run from the Execute menu to run the program. The starting statement for execution will be highlighted (the first executable statement in the Procedure Division in this case).
    After program execution, click on the OK button on the Run window to return to the Animator.
  
After running your program, the last statement executed will be highlighted (usually STOP RUN). In order to rerun you program without recompiling it you have to select the option to Restart Application from the Execute menu, otherwise your program will start execution from the highlighted statement (the end of the program).

--------------------------------------------------------------------------------

Instructions for Compiling and Executing Sample Code

Lab Exercise:

Follow the steps to get to the Animator Edit+Execute screen for a new file.

Type the SAMPLE code discussed in class.

Save the file on your diskette.

Continue to follow the steps to check (compile) your program.

Before you can execute your program, you must create the data on your diskette "A:\infile1.txt".

If the check step produces errors, correct the syntax errors and check again.

When you receive the message 'STOP RUN encountered with RETURN-CODE = H'00000000' , your program executed successfully.

Be sure to save the final version of your program.

After you have compiled and executed your program, verify that you have files with the following extensions on your diskette:


File Extension Meaning

.CBL        COBOL source code. Used for input to the Checker(compiler).

.INT          Short for 'intermediate code', a compact binary code which is produced by the Checker (compiler), and which can be executed.

.LST  or no extension
  
             Compiled source listing produced by the Checker (compiler) when the LIST file option is selected.

.IDY       An Animator information file, produced by the Checker (compiler) and used by the Animator.


Lab Exercise

1.Create the input file infile1.txt on your diskette and save as "A:\infile1.txt"
    The data is: 
WALT BECHTEL             40750
NELSON KERBEL          35800
MARGOT HUMMER        42550

2.Follow the steps to get to the Animator Edit+Execute screen for a new file.

3.Type the following code:

IDENTIFICATION DIVISION.
PROGRAM-ID. EXAMPLE.
AUTHOR. YOUR NAME.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO "A:\infile1.txt"
    ORGANIZATION IS LINE SEQUENTIAL.
SELECT OUTPUT-FILE ASSIGN TO "CON"
    ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE.
01 INPUT-REC PIC X(50).
FD OUTPUT-FILE.
01 OUTPUT-REC PIC X(50).
WORKING-STORAGE SECTION.
01 ARE-THERE-MORE-RECORDS PIC XXX VALUE 'YES'.
PROCEDURE DIVISION.
100-MAIN-MODULE.
    OPEN INPUT INPUT-FILE
        OUTPUT OUTPUT-FILE
    PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO '
        READ INPUT-FILE
            AT END MOVE 'NO ' TO ARE-THERE-MORE-RECORDS
            NOT AT END PERFORM 200-PROCESS-RECORD
        END-READ
    END-PERFORM
    CLOSE INPUT-FILE OUTPUT-FILE
    STOP RUN.
200-PROCESS-RECORD.
    MOVE INPUT-REC TO OUTPUT-REC
    WRITE OUTPUT-REC.

4.Save the file on your diskette.

5.Continue to follow the steps to check(compile) and run(execute) your program.

6.If the check step produces errors, correct the syntax errors and check again.

7.When you receive the message 'STOP RUN encountered with RETURN-CODE = H'00000000' , your program executed successfully.

8.Be sure to save the final version of your program.

9.In the DePaul labs, for the output to print, you must completely exit the Micro Focus software.

10.After you have compiled and executed your program, verify that you have files with the following extensions on your diskette:

File Extension Meaning

.CBL COBOL source code. Used for input to the Checker(compiler).

.INT Short for 'intermediate code', a compact binary code which is produced by the

Checker (compiler), and which can be executed.

.LST (or no extension) Compiled source listing produced by the Checker (compiler) when

the LIST file option is selected.

.IDY An Animator information file, produced by the Checker (compiler), used by the Animator.