LAB1 CSE314

Assigned/Due

Goals

Part A - The Unix Tutorial

Read and follow the directions found in the Unix Tutorial. 

Answer the HW questions for the Unix Tutorial.

Part B - Your First Program

Type in the program and input file given into separate files.  Save the program with the filename lab1.cob and the input file with the filename lab1in.dat  Remember to follow the column rules when typing in your COBOL program (your lab1.cob file).  When you type in the input file data (lab1in.dat), you need to watch the column number at the bottom of your file carefully.  Sometimes, the column number starts with the number 0! Yes, zero!  Put your cursor in the top left position in the file and check the column number.  It probably says C0 for column zero.  If this is the case, then the second field needs to start in column 20 since columns 0-19 would be the first 20 spaces for the first field.

Be sure to use the correct names for your files as listed in the lab handout.  A 20% penalty will be deducted from your final score for this lab if you forget.  This applies to all future labs as well.  This course policy is also listed on the course information page of the instructor’s website.

At the terminal window (i.e. the % prompt), type ccbl lab1.cob to compile and link the source code file. This will create an executable file with the name of the program plus the extension .acu (instead of the .cob extension).  If you have compiler errors, go back to emacs to make corrections, save the file, and re-compile.  You must save and re-compile your program after every change. Remember, you can open more than one window at a time.  I would recommend that you open one XEmacs window with your program and another window with your prompt.  You can use the Line number in emacs to determine the approximate location of the error.  However, it can be confusing to find a compiler error since the error message occurs after the actual error has occurred, thus you (usually) need to look at the statement prior to the error message statement for the problem.

Once you have no compiler errors, run the program:  runcbl lab1

UNIX has an extensive, on-line reference manual. To get more information about a command, type "man" followed by the name of the command.  For example:  man ls to learn more about the list command.   For more information about man itself, type man man. "man" functions, just like "more" - use the space bar or the Enter key to scroll or Ctrl-C to cancel.

The submit Command

When you are finished with a lab, you need to submit the lab1.cob file for grading. The submit command submits your lab electronically. You must use the submit command to turn in your labs; emails and printouts are not acceptable. The submit command also puts the date/time on the files that were submitted so that we know when the files were turned in.  The grader will be checking this time to determine if a lab was turned in "on-time" or "late".  The submit command is entered as follows:

submit classname labname files-to-submit

Where

classname is the name of the CSE 314 section that you are enrolled in. Your classname is usually c314aa but may change depending on the quarter offerings.  If two sections of the course are offered, the additional classname will be c314ab.

labname is the lab you are working on (lab1, lab2, etc – no spaces between the word lab and the number)

files-to-submit is a list of the files that make up the lab. These files include COBOL programs, input files, text files, and/or record definitions.

Note that all of the files in a lab must be submitted using one command. If you use two submit commands, the second submit erases the files from the first submit.  Since the grader does not have the entire lab to grade, you lose points.

Also, note that programs must be submitted in source code form. For example, if you submit "prelab.acu" instead of "prelab.cob", you will have, at a minimum, points deducted equivalent to submitting a day late (20%).

Each submit command must be entered on one line, without pressing Enter. If the line you are entering is too long, it wraps onto the next line.

Submitting Lab1

Remember, depending on what CSE314 section you are in, the portion after the word "submit" (i.e. the classname) may be different.

submit c314aa lab1 lab1.cob

External Documentation

There is no external documentation required for this lab.

Deleting Unnecessary Files

As you work you create disk files, most of which do not need to be kept. These unnecessary files occupy disk space, and if not erased will eventually fill your disk quota. When this happens, you cannot save any other files, no matter how important.  To help prevent this from occurring, there is a command called “clean” in the class directory (/usr/class/cis314/). Copy it in to your home directory using the UNIX cp command (see the tutorial), and every so often enter the command.

clean

This will delete any unnecessary files from your home directory, leaving you more disk space.