BCIS 4620 – Spring 2009

Assignment #3:  NetExpress COBOL/SQL

(20 points)

 

DUE:  Feb 19, 2009

 

The files needed for this assignment may be found on the course website: 

BCIS 4620 Faculty/Course Website; SQL_COBOL zip file:

 

REQUIREMENTS:

========================================================================

GENERAL

 

Detailed printing and turn in instructions are contained below.  Only turn in the parts of the assignment which are required.  Please bring the SQLCOBOL.CBL listing and output to class for note taking purposes.

 

With this assignment you will learn the basics of COBOL programming with embedded SQL statements in the NetExpress environment.

 

You will need to obtain the following new input datasets, which may be found on 4620 Class Website: SQL_COBOL.zip file:

 

- SQLCOBOL.CBL

- FILE.INFILE

 

You will also need the

-EMPLOAD.SQL – Use this file to create both EMP and EMPLOYEE

EMPLOYEE is a backup copy of EMP.

-DEPTLOAD.SQL – Use this file to create both DEPT and DEPARTMENT       

DEPARTMENT is a backup copy of DEPT.

-VPHONE.SQL – This creates a “view” file

 

Upload the SQL code into SQL Wizard environment.  You may wish to use the RUN BATCH option.  BE SURE to change the file prefixes LLLL to your LOCATION name and SSSS to the SQLID you will be using before executing the SQL files. 

 

Also, create a second copy of the DEPT table as a backup table.  The COBOL program refers to this table as TUTORIAL.TUTORIAL.DEPARTMENT.  Make sure your database table name and the program reference name agree.

**Print the contents of EMP, DEPT and VPHONE at the start of processing.  Use your own SELECT statements to print out the contents of the each TABLEs and the VIEW.  Turn in the three (3) outputs as Table Views.

 

Properly insert dividers with explanations for each of the above sections.   Logically group the file listings and reports by section (A.—Tab 1, B.—Tab 2, C.—Tab 3).  Be sure to include a cover page and a Table of Contents.  Also, make sure your name is on the 3-ring binder’s spine.

 

A.  COBOL pre-compiler/compiler (A. and B.; 10 points total)

Since SQLCOBOL.CBL has embedded SQL statements you must REBUILD it before it is RUN.  You may wish to add the copyfile SQLCA.CPY to your project folder.

 

Be sure to change all prefixes in the SQLCOBOL.CBL program to the Location and the SQLID you intend to use for you database space.

 

Store the SQLCOBOL.CBL  and the INFILE.FILE in the same new NetExpress Project folder.  OUTFILE.FILE will also be sent to this folder.

 

**TURN in a printout of the SQLCOBOL.CBL program and the INFILE.FILE after you have made all the prefix changes.

 

B.  Execute NX COBOL Animator

Suggest you run REFRESH in batch mode (change to .SQL file type) to refresh the data in EMP and DEPT from their backup files.

 

Run the SQLCOBOL.CBL project when all location prefixes have been renamed and all the tables and views have been correctly installed.

 

Output will appear in file FILE.OUTFILE and the Execution Window.

 

**Print BOTH (3 printouts actually) and TURN IN:

 

**--FILE.OUTFILE (Automatically placed in project folder subdirectory)

**--SELECT * ... to print the final contents of EMP and DEPT tables

   Print directly from the SQL Wizard environment.  (2 OUTPUTS)

   Issue "select * from emp;" and "select * from dept;" commands

   (Highlight changes or MARK “NO CHANGES” in the EMP and DEPT Tables)

 

C.    NX SQL Programs (10 points)

IMPORT and execute the SELECTnn.SQL (where nn is 05 through 24) programs provided in this zip file.  Print out the SQL View and the Table View for each program.  Be sure to change the NNXX to the correct Location and SQLID you used to store the EMP, DEPT, and VPHONE

objects.

 

Use MS/NX EXPORT utility to export a copy the DEPT and EMP files you created.  Print a copy of the .EXP  you created and saved.


Homework #3

Table of Contents

Tab

Description

Page

 

Selects and COBOL Pre-Compiler/Compiler

 

1

Select SQL DEPT SQL View

1

1

DEPT Table View – Landscape

2

1

Select SQL EMP SQL View

3

1

EMP Table View – Landscape

4

1

Select SQL VPHONE SQL View

6

1

VPHONE Table View – Landscape

7

1

SQLCOBOL.CBL – Edited

8

1

INFILE.FILE

 

 

Execute NX COBOL Animator

 

2

FILE.OUTFILE

 

2

Select SQL DEPT Table View

 

2

DEPT Table View – Landscape

 

2

Select SQL EMP Table View

 

2

EMPLOYEE Table View – Landscape

 

 

NX SQL Programs

 

3

Select05 SQL/Table View

 

3

Select06 SQL/Table View

 

3

Select07 SQL/Table View

 

3

Select08 SQL/Table Views

 

3

Select09 SQL/Table Views

 

3

Select10 SQL/Table View

 

3

Select11 SQL/Table Views

 

3

Select12 SQL/Table View

 

3

Select13 SQL/Table View

 

3

Select14 SQL/Table Views

 

3

Select15 SQL/Table Views

 

3

Select16 SQL/Table View

 

3

Select17 SQL/Table View

 

3

Select18 SQL

 

3

Select19 SQL/Table View

 

3

Select20 SQL/Table View

 

3

Select21 SQL

 

3

Select22 SQL/Table View

 

3

Select23 SQL

 

3

Select24 SQL

 

3

EXPORTed DEPT.EXP file

 

3

EXPORTed EMP.EXP file