Introduction to Tables/Arrays Please use the speaker notes for additional information. Tables/Arrays.

Slides:



Advertisements
Similar presentations
Relational database - student system As always please use speaker notes!
Advertisements

1/8 AND, OR and NOT b How many boys? b How many girls? b How many blue? b How many red?
Check Digit - Mod 11 Please use speaker notes for additional information!
PL/SQL User Defined Types Record and Table Please use speaker notes for additional information!
Chapter 12 Array Processing and Table Handling. Defining Series of Input Fields Coding record with 24 independent hourly fields is cumbersome 01Temp-Rec.
Reports Using SQL Script Please check speaker notes for additional information!
Final Total Lines in COBOL Please be sure you can see the speaker notes - they contain additional information!
AP STATISTICS Simulating Experiments. Steps for simulation Simulation: The imitation of chance behavior, based on a model that accurately reflects the.
Group functions using SQL Additional information in speaker notes!
Screen Section Please use speaker notes for additional information!
Relational example using donor, donation and drive tables For additional information see the speaker notes!
More on IF statements Use speaker notes for additional information!
SQL Use of Functions Character functions Please use speaker notes for additional information!
Two and three dimension tables Please use speaker notes for additional information!
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan SPUFI Hands On Introduction to Embedded SQL DCLGEN.
Introduction to Class Modules Please use speaker notes for additional information!
Cursors in PL/SQL Includes cursor example and continuation of first cursor example Please use speaker notes for additional information!
Modifications to program Addda.cbl Please use speaker notes for additional information!
Break Processing Please use speaker notes for additional information!
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
XML with ASP using ASP:DataList Please use speaker notes for additional information!
Introduction to XML Please use speaker notes for additional information!
Array - adding to array at run time Please see speaker notes for additional information!
Using XML with ASP and the ASP:Repeater Please use speaker notes for additional information!
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
More on views Please refer to speaker notes for additional information!
SQL and Conditions Speaker notes will provide additional information!
Explanation of SAMPLEIF (if88in1.cbl or if88in1.html) Please use speaker notes for additional information!
Manipulating data within PL/SQL Please use speaker notes for additional information!
Introduction to Access 2010 CIS120first.accdb is the database I am creating.
Exceptions in PL/SQL Please use speaker notes for additional information!
Any Questions!. Test Coming Up! Agenda Printing with Externally Described Printer Files Arrays.
COBOL Screens Please use speaker notes for additional information!
DATA RETRIEVAL WITH SQL Goal: To issue a database query using the SELECT command.
Introduction to Oracle - SQL Additional information is available in speaker notes!
Introduction to Testing CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Programming Assignment #2 in CIS12 Please use speaker notes for additional information!
HOW TO WRITE A PROPER HYPOTHESIS START HERE. THE OPTICAL ILLUSIONS TEST NOT LONG AGO, MR. SMITH, MRS. PETERS, AND I WERE DISCUSSING SCIENCE TOGETHER.
More on Primary and Foreign Keys Please see speaker notes for additional information!
Analysis of SAMPLE1.CBL Please check speaker notes for additional information!
Patterns and Relationships
Divisibility.
RETRIEVE A NO. OF ROWS ¦ Declare a cursor ¦ Open the cursor ¦ Fetch rows of data ¦ Stop fetching rows ¦ Close the cursor.
Random update Please use speaker notes for additional information!
Division Division Problems Do you have problems with division problems? Here is a guide to help you.
Reviews of probability Question 1: Suppose we have a “ABCDE” litters how many words we can compose from them with 4 litters without repetition.
Visual Basic - Break Processing
Tables In COBOL An Introduction
Using character conversion to display non standard Unicode values
Screen I/O ACCEPT DISPLAY Relevant to the Fujitsu Compiler.
Prepared Statements Function and Triggers
Introduction to Procedures
Introduction to the Array
Model Functions Input x 6 = Output Input x 3 = Output
Department Array in Visual Basic
مسئله‌يابي Problem Solving
مسئله‌يابي Problem Solving
Please use speaker notes for additional information!
Introduction to Views and Reports
Type your title Type your name Type your major departments
Searching an Array or Table
Indexed File Processing
Title of Study Presenter names Major department names
Department of Psychological Science, Saint Vincent College
Date Conversion Program
Introduction to Access 2010
Functions and Tables.
Introduction to Relational Database Introducing PRIMARY KEY
[Type your title] [Type your full names here].
Please use speaker notes for additional information!
Presentation transcript:

Introduction to Tables/Arrays Please use the speaker notes for additional information. Tables/Arrays

01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. MENS^^WOMENSGIRLS^BOYS^^ Table set-up DEPT-NAME(1) DEPT-NAME(2) DEPT-NAME(3) DEPT-NAME(4) The table is set up with four names for the four departments. Then the table is redefined to look at the table in a different way. The redefinition results in 4 fields each with the name DEPT-NAME and all 6 characters long. This is done with the OCCURS which essentially says there are 4 DEPT-NAMEs. Therefore, to use DEPT-NAME we have to modify it with a SUBSCRIPT or pointer to tell which DEPT-NAME we want. In the example below, there is DEPT-NAME(1), DEPT-NAME(2) etc. In this example, we are using actual numbers as the subscript to tell which DEPT-NAME. Character or position within table - total of 24 characters

Input: 05 DEPT-NO PIC 9. 1 MENS 2 WOMENS 3 GIRLS 4 BOYS Table use: 01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. In the PROCEDURE DIVISION: B-200-LOOP. MOVE EMP-IDNO TO EMP-IDNO-PR. MOVE EMP-NAME TO EMP-NAME-PR. MOVE DEPT-NAME (DEPT-NO) TO DEPT-NAME-PR. MOVE SALARY TO SALARY-PR. The MENS dept will have a code of 1 in DEPT-NO, the WOMENS dept will have a code of 2 in DEPT-NO, 3 for the GIRLS and 4 for the BOYS. This line will move the DEPT-NAME subscripted by the DEPT-NO to DEPT-NAME-PR. Lets say the input record had 3 in DEPT-NO, than moving DEPT-NAME(DEPT-NO) will move GIRLS to DEPT-NAME-PR.

Input records: 11111Mary Smith Jennifer Ames Stephen Daniels Carl Hersey Output records: Mary Smith WOMENS $40, Procedure Division MOVE: 2 MOVE DEPT-NAME (DEPT-NO) TO DEPT-NAME-PR. 01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. Input: 05 DEPT-NO PIC 9. Move DEPT-NO=2 points here.

Input records: 11111Mary Smith Jennifer Ames Stephen Daniels Carl Hersey Output records: Mary Smith WOMENS $40, Jennifer Ames GIRLS $40, Procedure Division MOVE: 3 MOVE DEPT-NAME (DEPT-NO) TO DEPT-NAME-PR. 01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. Input: 05 DEPT-NO PIC 9. Move DEPT-NO=3 points here.

Input records: 11111Mary Smith Jennifer Ames Stephen Daniels Carl Hersey Output records: Mary Smith WOMENS $40, Jennifer Ames GIRLS $40, Stephen Daniels BOYS $40, Procedure Division MOVE: 4 MOVE DEPT-NAME (DEPT-NO) TO DEPT-NAME-PR. 01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. Input: 05 DEPT-NO PIC 9. Move DEPT-NO=4 points here.

Input records: 11111Mary Smith Jennifer Ames Stephen Daniels Carl Hersey Output records: Mary Smith WOMENS $40, Jennifer Ames GIRLS $40, Stephen Daniels BOYS $40, Carl Hersey MENS $40, Procedure Division MOVE: 1 MOVE DEPT-NAME (DEPT-NO) TO DEPT-NAME-PR. 01 DEPT-TABLE. 05 FILLER PIC X(6) VALUE ”MENS ". 05 FILLER PIC X(6) VALUE ”WOMENS". 05 FILLER PIC X(6) VALUE ”GIRLS ". 05 FILLER PIC X(6) VALUE ”BOYS ". 01 RDF-DEPT-TABLE REDEFINES DEPT-TABLE 05 DEPT-NAME PIC X(6) OCCURS 4 TIMES. Input: 05 DEPT-NO PIC 9. Move DEPT-NO=1 points here.