New Jersey Institute of Technology (NJIT)
Computer and Information Science Department (CIS)
CIS365-001: File Structures and Management, Fall 1999
Professor: Michael Bieber

Fujitsu COBOL Tutorial - Version 2

To do this tutorial, refer to the instructions on the handout "Installing, Editing, Compiling, ... Fujitsu COBOL"

Do each of the seven parts on this tutorial. Each teaches a skill you will need to know when the programs get more complex.

 

Part 1

Type in, compile (with the compile options), link (with the link options) and execute (using the WINSVD debugger) the program "calc1.cob" (without the line numbers). If you have any syntax errors, then return to the editor to fix them. Start WINSVD. (Because this program does not use files, you do not have any additional execution parameters for the "Environment Variables Information" window - just click on OK.) You should see the first line of your procedure division highlighted in yellow. Use the go option in the debugger. Ensure you get the appropriate output displayed in the Console window.

 

Part 2

Now look at how the program actually executes. Please do each of these steps!

  1. Use the re-debug option to set-up for execution again.
  2. Use the watch data option to set a watch on the variables: result-calc and start-constant. (Type the variable name in the data-name field of the watch data form and choose set. Resize each watch window so you can also see your main program window.)
  3. Execute the program line-by-line using the step-into option. Make sure you understand why and how the values of the variables change. Note that you won't be able to see the console window until your program has executed completely and reached STOP RUN.
  4. Use the re-debug option to set-up for execution again.
  5. Now execute the program line-by-line using the animate option to see how it works.

 

 

Part 3

Type in the program "calc2.cob" (without the line numbers). Compile using the compile options. Fix the syntax errors in the program in the editor. Re-compile with the compile options, link with the link options, and then start WINSVD. (Because this program does not use files, you do not have any additional execution parameters for the "Environment Variables Information" window.) You should see the first line of your procedure division highlighted in yellow. Use the go option in the debugger. Ensure you get the appropriate output displayed in the Console window.

 

Part 4

Now look at how the program actually executes. Please do each of these steps!

  1. Use the re-debug option to set-up for execution again.
  2. Use the watch data option to set a watch on the variables: result-calc, start-user and end-user.
  3. Execute the program line-by-line using the step-into option. Make sure you understand why and how the values of the variables change. Note that you will only see the console window when you need to input data. Sometimes you will need to bring the console window up manually to input data. Otherwise you won't be able to see the console window until your program has executed completely and reached STOP RUN.

 

Part 5

Use a Web browser to display and save the following program: http://www.cis.njit.edu/~bieber/outgoing/makepay.cob. Save it to your own hard drive, compile, link and execute (using the debugger). When executing you have to add a parameter for the output file: "OUT=payments.dat" (without quotation marks) where payments.dat will be the name of the output file this program creates.

Run the program using the go option in the debugger. Ensure you get the appropriate output displayed in the Console window. Note that for all aphanumeric input (PIC X variables) you must enter enough blank spaces to pad it the length of the variable. This includes the "no " that ends your program.

 

Part 6

Now look at how the program actually executes. Please do each of these steps!

  1. Use the re-debug option to set-up for execution again.
  2. Use the watch data option to set a watch on payment-record-out and continue-user and more-payments-flag
  3. Execute the program line-by-line using the step-into and step-over options. Make sure you understand why and how the values of the variables change. Note that you will only see the console window when you need to input data. Sometimes you will need to bring the console window up manually to input data. Otherwise you won't be able to see the console window until your program has executed completely and reached STOP RUN.

 

Part 7

View your output file using the Fujitsu File Utilities. Note that you have to give a record length of 35 - 2 greater than the actual length.

 


last update: 9/16/99

This page: http://www.cis.njit.edu/~bieber/CIS365F99/tutorial.html