Class05.1_NX_SQL_COBOL_Tutorial_Spring2009

Class05.1_NX_SQL_COBOL_Tutorial_Spring2009 - Class 5.1 BCIS...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Class 5.1 BCIS 4620 TUTORIAL: COBOL with Embedded SQL Code Spring 2009 Dr. Jack Becker SQLCOBOL.CBL Homeworks #3 and #4 Homework #3 is a run as a COBOL program Homework #4 is a BONUS program worth 10 pts and requires some tailoring of the SQLCOBOL.CBL program. Key features: Control Breaks Subtotals and Totals COBOL w/Embedded SQL COBOL Program DATA DIVISION. File Section. Select Assign Working-Storage Section. Declare Section. SQL/DB2 Data Dictionary Empno Ename Lastname Firstname Deptno ... Procedure Division READ input- file record DECLARE vcur CURSOR SQL FETCH vcur-view-row File Data SQL/DS Data FILE.INFIL E FILE.OUTF ILE Tables: EMP, DEPT EMPLOYEE DEPARTMENT Embedded SQL in COBOL Host EXEC SQL OPEN VCUR END-EXEC . SQL04230 EXEC SQL FETCH VCUR INTO SQL04240 :VLASTNAME, :VFIRSTNME, :VPHONENO:PIND, :VEMPNO, SQL04250 :VDEPTNAME, :VDEPTNO SQL04260 END-EXEC. SQL04270 IF SQLCODE = NOT-FOUND SQL04280 WRITE REPREC FROM MSG07 SQL04290 AFTER ADVANCING 2 LINES SQL04300 Successful Application Output Module [DISPLAY statement] Results are placed in: FILE.OUTFILE Program results are WRITEned into: FILE.OUTFILE And placed in same directory as the FILE.INFILE Basic COBOL Program Structure http://cobol.404i.com/basics.html http://www.csis.ul.ie/COBOL/Course/COBOLIntro.h IDENTIFICATION DIVISION. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. SECTIONS. PARAGRAPHS. LEVEL numbers: 01, 02, 05, 49, 77, 88 COBOL Fundamentals Source Code Zones Column 7: Comment code * Columns 1-7: Blank Columns 8-11: Zone A Begin Divisions, Sections, Paragraphs Columns 12-72: Zone B Any COBOL statement Columns 73-80: ID number (text; comment only) COBOL Fundamentals more Statements can span multiple lines, BUT always end with a period (.) ....
View Full Document

Page1 / 26

Class05.1_NX_SQL_COBOL_Tutorial_Spring2009 - Class 5.1 BCIS...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online