440 likes | 650 Views
Welcome to BAC344 Business Applications using COBOL. Azmat Bhatti azmat.bhatti@senecacollege.ca. Term Marks Breakdown. Two Mid-Term tests (40%) Two Assignments (30%) One Final Exam (30%). About Yourself -Name -CPA or CPD program -Credit or Audit -Or Why are you here?.
E N D
Welcome to BAC344Business Applications using COBOL Azmat Bhatti azmat.bhatti@senecacollege.ca
Term Marks Breakdown • Two Mid-Term tests (40%) • Two Assignments (30%) • One Final Exam (30%)
About Yourself-Name-CPA or CPD program-Credit or Audit-Or Why are you here?
Why are we studying COBOL? • Traditional Structured Programming & Design Techniques. • Transactional Processing • How to use our DB2 skills learned in IBC233 • Learn some COBOL syntax! • Maintain Legacy systems
Build up on prior courses! • IPC144 • Transaction processing • Arrays • IBC233 • Interactive screens • OPS400 • iSeries IBM AS/4000 System
Power System Model 520 IBM Midrange Computer zeus.senecac.on.ca
System 3 1969 - 1985 History of AS/400 System 32 1975 - 1984 System 34 1977 - 1985 System 36 System 38 1983 - 1994 1980 - 1994 AS/400 1988 - present iSeries 2000 - present system i 2005 - 2006 i 2007 Power Systems 2008 IBM i 2014
IBC233 Review IBM iSeries AS/400 Overview
Seneca Network (simplified) and connectivity to AS/400 MATRIX ZEUS (Power Systems) PCs in the Lab PCs at Home Fire Wall
Connectivity Software • Telnet doesn’t work - doesn’t support system i Function Keys • Rational Developer (RDI) • Client Access (Available from CS Students Download site at Seneca) • Mochasoft (at home) • Available for download from the CS site. • Select Software for Windows ‘95 and look for MOCHA • Or from http://mochasoft.dk/ 30 days trial version. Uninstall and download again after 30 days or pay for the full version.
Facts about ibm i • Operating System (OS/400, i5/OS) • Object-Based • Everything that takes up space and has a description is an object • Types of Objects include: • User Profiles • Job Queues • Files • Programs
Traditional ibm i Data Storage Hierarchy Library Objects Members contain data - Files only
Traditional IBM i Data Storage Hierarchy Azmat - *LIB BAC344LIB - *LIB OPS400 - *LIB QCBLLESRC *FILE OPS400 *OUTQ Object1 *PGM PGM1 QCBLLESRC *FILE Object2 *OUTQ PGM2 PGM3 PG1 Object3 *FILE PG2 PGM1 *PGM Object4 *JOBQ PG1 *PGM PGM3 *PGM
Library Lists • Each job has an attached Library List • Different Types of Libraries: • System: IBM Supplied • Product: Added automatically when an IBM product is used • Current: Defined by an individual user ID • User ID’s default Library • User: Non-IBM Supplied Libraries • Created by Business to organize programs, files, etc.
Library Lists • Object used to organize data storage. • Are different for each student. • Get set back to your “default” when you signoff.
IBM i finds Objects • Qualified Names Library/Object BAC344LIB/QCBLLESRC • Using Library Lists! How are Library Lists sequenced?
System vs Subsystem • System = ZEUS • Subsystem is a logical grouping of resources such as QINTER, QBATCH etc etc.
Database IBM DB2/400 on the IBM i
Physical Files vs Logical Files • PF holds data • PF consists of record format • PF consists of file/field definitions • PF may hold KEY fields • LF is a view to a selection of subset of data • LF does not hold any data • LF has KEY fields defined with Ascending or Descending or other options
CL Control Language
CL Syntax Command-name (space) parameter
Keyword vs Positional Notation Keyword WRKOUTQ OUTQ(PRT01) CRTLIB LIB(STUDENT1) + TEXT(‘Student1 Library’) Positional WRKOUTQ PRT01 CRTLIB STUDENT1 *PROD ‘Student1 Library’
Naming of Commands • Based on English! • Combination of Verb and Noun CRTLIB Library Create
CL Syntax • Use Menus to find the command • Use F11 and Help to find the Syntax
Commands that you’ll use? • STRPDM • Look at SEU
Week 1 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data
Agenda • How does a compiler work? • Creating a COBOL Program • Parts of a COBOL Program • The Perform Statement • Defining Files • Defining Variables • COBOL Verbs
Compilers • Translate programs written by humans into Machine Language Code.
COBOL Compiler on the iSeries Compiled Listing (PGM1) Source Code QCBLLESRC (PGM1) COBOL Compiler Program Object (PGM1)
Steps to Create a COBOL Program 1. Create a Source Physical File - QCBLLESRC 2. Create a Source Member in the Source Physical file with the type CBLLE 3. Type in the COBOL code using SEU 4. Exit & Save 5. Compile
What is COBOL? • Designed by the US defense department • Meant to be English like for ease of maintenance COmmon Business Oriented Language
Parts of a COBOL Program • Identification Division • Environment Division • Data Division • Procedure Division (See Page 51 of your text)
Identification Division(Syntax) IDENTIFICATION DIVISION. PROGRAM-ID. program-name. [AUTHOR. [comment-entry] … ] [INSTALLATION. [comment-entry] …] [DATE-WRITTEN. [comment-entry] …] [DATE-COMPILED. [comment-entry] …] [SECURITY. [comment-entry] …]
Identification Division • Required • Name of the Program in the Program-ID paragraph. • Optional • Author • Installation • Date-Written • etc.
Environment Division(Syntax) [ENVIRONMENT DIVISION.] [CONFIGURATION SECTION.] [SOURCE-COMPUTER. AS/400.] [OBJECT-COMPUTER. AS/400.] [INPUT-OUTPUT SECTION.] [FILE-CONTROL.] [SELECT nice-file-name ASSIGN to DISK/PRINTER/WORKSTATION- physical-file-name.]
Environment Division • INPUT-OUTPUT SECTION is only required if your program uses files. • Contains the FILE-CONTROL paragraph • DISK • PRINTER • DATABASE • WORKSTATION • FORMATFILE • similar to setting up file pointers
Select for a Database File Select Product-File Assign to disk-PRODPF. Select Product-file Assign to database-PRODPF Access is Sequential.
Select Statement for a Display-File Select Display-File assign to workstation-PRDSPF organization is transaction. Select Display-File assign to workstation-PRDSPF-SI organization is transaction.
Select Statement for a Spooled File Select Product-Report assign to printer-qprint. Select Product-Report assign to printer-qsysprt.
Select Statement for an Externally Described Printer File Select Product-Report assign to formatfile-qsysprt.