370 likes | 589 Views
BCIS 4620 Assignment #3 SQLCOBOL Project. Running COBOL with Embedded SQL Code. Assignment Overview. Project folder created All files included; FILE.INFILE, SQLCA.CPY Edit COBOL program. SQLCOBOL.CBL Maintain SQL Environment CREATE all TABLEs and VIEWs DEPT, DEPARTMENT, EMP, VPHONE
E N D
BCIS 4620Assignment #3SQLCOBOL Project Running COBOL withEmbedded SQL Code
Assignment Overview • Project folder created • All files included; FILE.INFILE, SQLCA.CPY • Edit COBOL program. SQLCOBOL.CBL • Maintain SQL Environment • CREATE all TABLEs and VIEWs • DEPT, DEPARTMENT, EMP, VPHONE • Primary, foreign key constraints • Rebuild/Run
We will use the SQLCOBOL.CBL program provided by Instructor Open a New PROJECT folder • I suggest you create the physical subdirectory first. • Put it on the Drive you plan to do most of your programming. • This may be your Flash Drive
READY? • Project folder created • All files included; FILE.INFILE, SQLCA.CPY • Edit COBOL program. SQLCOBOL.CBL • Maintain SQL Environment • CREATE all TABLEs and VIEWs • DEPT, DEPARTMENT, EMP, VPHONE • Primary, foreign key constraints
BCIS 4620Assignment #3SQLCOBOL Project(CONTINUED) Running COBOL withEmbedded SQL Code
Correct “Application Output” window [Produced by DISPLAY statement] Program results are “WRITEned” into: FILE.OUTFILE And placed in same directory as the FILE.INFILE
Did You Get an SQLCODE: -1100/-1352/etc. ?? SQL errors may be caused by many things. See lists of SQLCODEs in the “HOT LINKS” section of my Course website. TIP: Make sure “SQL0xxxx” COBOL Sequence numbers are all in Columns 73-80.
Export EMP to MYEMP.SQL“RUN” when ready! NOTE: EXPORT box settings: FORMAT: SQL Check boxes: Comment, Insert, Create, Index
When Promted; Say “Yes” SAVE AS: MYEMP.EXP file
IMPORT utility may be used to LOAD external data files into the DB2 database Several Formats are supported ASCII, dBase, etc.