CSCI 320 Lab 1


COBOL Programming on the VAX - Learning the programming environment and general VAX terms.

Today we will be typing in and running our first program, the sample program found in Chapter 1, page 23, also found on 30.

Log onto Windows using your normal user id and the initial password, your birthdate (if you had a Linux account, your former password will still be preserved). Immediately change your password to a six to eight letter password of your choice. If you pick something with a number in it, the same password can also be used in the LINUX system and also on the VAX

Telnet to balta (pathname is balta.edinboro.edu). You should click on the TeraTerm or Putty (or some telnet program) icon to start. Here you should log on using your normal id and the initial password made from your birthdate, mmddyy. You may again be asked to change your password. (It is possible that you may still have a former VAX account. In this case use your old password).

Start the editor with

$ EDIT/EDT SAMPLE.COB

At the * type the letter ‘C’ then press enter.

Type in the program in figure 1.10 (page 23) making the following changes as you type.

Omit the first 7 columns. The A margin can begin in the 1st column and the B margin can begin in column 5. (This eliminates the sequence number.) These margins are important, but the other spacing is arbitrary. For example, on lines 9 and 14 (see columns marked serial), the FD must start in column 1, and PAYROLL-LISTING in or after column 5, but other statements within the paragraph can start anywhere.

You will get tired of typing PICTURE. The abbreviation PIC is acceptable.

After PROGRAM-ID. SAMPLE. add

AUTHOR. YOURNAME.

In FILE-CONTROL use your actual file names, e.g.,

SELECT EMPLOYEE-DATA ASSIGN TO ‘SAMPLE.DAT’.

SELECT PAYROLL-LISTING ASSIGN TO ‘REPORT.DAT’.

Close the editor with cntl/z (then type) EXIT. This will quit and save. [If you wanted to quit without saving your would type cntl/z QUIT.]


Make a data file. Start the editor again with $ EDIT/EDT SAMPLE.DAT type

QUINN, FRANK 10450 ( the 10450 must start in column 21)

MARSALES, WINTON 06550

WHETHER, STORMY 33990

           Exit with cntl/z EXIT


Compile your program with

$ COBOL/LIS/WARNINGS=ALL SAMPLE.COB

You may have lots of errors. You can ignore warnings. Fix the errors by returning to the editor and saving again. Use the up arrow key to get Alpha to cycle through the last few commands you have typed. This will save you having to retype the compile command. Repeat this cycle until no serious errors come up.

Link the program.

$ LINK SAMPLE

Run the program.

$ RUN SAMPLE

Your output is going to a file. You may view it by typing,

$ EDIT/EDT REPORT.DAT



To Finish -  Log out of the VAX