How’s assignment 1 coming? Winter 2007

Slides:



Advertisements
Similar presentations
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Advertisements

Database Design Week 10.
iSeries Database Files
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
ISP 121 Week 1 Introduction to Databases. ISP 121, Winter Why a database and not a spreadsheet? You have too many separate files or too much data.
Attribute databases. GIS Definition Diagram Output Query Results.
Database Software Application
Chapter 2 Querying a Database
Session 8-1 Session 8 The Power and Flexibility of EDExpress.
1 Lesson 22 Getting Started with Access Essentials Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Mail merge letters are used to send the same or similar documents to many different people. Since they contain the recipient’s name, address, and other.
Microsoft Access Get a green book. Page AC 2 Define Access Define database.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Microsoft Access Data Base Application. A Few Terms Database – A collection of related information. Database – A collection of related information. Field.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
Microsoft Access 2010 Building and Using Queries.
Presentation © Copyright 2002, Bryan Meyers Externally Described Files Chapter 6.
Lesson 17 Getting Started with Access Essentials
Data Types and RunSQLSTM. Agenda Lab 1 demo this week –Bring your lab notes! Create your own Data Types Label on Authority RunSQLstm.
WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.
Microsoft Access You will need a pen/pencil.. What is Microsoft Access? Access is a database management system.  Create a database, add/change delete.
Colleague, Excel & Word Best of Friends Presented by: Joan Kaun & Yvonne Nelson College of the Rockies.
Lecture 21 Lecture 2: Using TSO and ISPF Tuesday, January 20, 2009.
1 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Accessing the AS/400 DATABASE Preparation for DATA storage Create a receptacle (file) internal -- in program or direct (output / crtpf) external -- with.
IBC233 Lecture 2 Updated Winter 2008 Agenda Test next Week – Jan 23 ISeries Architecture CL (Control Language) Library Lists Operations Navigator.
Week 4 presentation! This week we will cover editing and the use of the on-board tools provided, SEU and PDM.
Database Objective Demonstrate basic database concepts and functions.
AdMIT Custom Export (new) The new Custom Export utility features an easier to use interface and more fields.
IBC233 Lecture 2 Updated Summer 2006 Agenda Review What’s ODIN doing? Library List Websphere –Filters.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
1 Week # 4 Introduction to PDM PDM is a workbench environment that lets programmers and system operators navigate the three levels of the AS/400’s object-based.
IBC233 Lecture 2 Updated Summer 2007 Agenda Real Estate Issues Review System Values What’s ODIN doing? Library List Websphere –Filters –Writing a CL.
1 Welcome! DBT544 students to the iSeries, DB2 Universal Database And SQL interface.
1 Week # 5 Agenda CL Programming CL Commands Job Logs Review for test # 1.
Course Contents Overview: Database basics Lesson 1: Benefits of using a database Lesson 2: Table that data Lesson 3: Analyzing, viewing, and reporting.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
To play, start slide show and click on circle Access 1 Access 2 Access 3 Access 4 Access Access
Mail Merge Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter.
3 A Guide to MySQL.
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
GO! with Microsoft Office 2016
IBC233 Week 6.
SQL and SQL*Plus Interaction
Practical Office 2007 Chapter 10
Word Tutorial 6 Using Mail Merge
Database application MySQL Database and PhpMyAdmin
GO! with Microsoft Access 2016
Week 12 Option 3: Database Design
Data File Import / Export
What is a Database? How is a Database use? How to set up in Access?
Database Vocabulary Terms.
ORACLE SQL Developer & SQLPLUS Statements
Any Questions?.
Introduction to Customizing Reports in SAP
Creating Tables & Inserting Values Using SQL
Data Types and Field Properties
Introduction to Customizing Reports in SAP
Flat Files & Relational Databases
Database Fundamentals
Displaying and Editing Data
Spreadsheets, Modelling & Databases
The ultimate in data organization
Microsoft Office Access is the best –selling personal computer database management system. What is Access?
Bent Thomsen Institut for Datalogi Aalborg Universitet
IBC233 Week 5.
Week 8! Any Questions?.
Presentation transcript:

How’s assignment 1 coming? Winter 2007 IBC233 How’s assignment 1 coming? Winter 2007

Agenda Test 2, Feb 19 Assignment 1? Due Feb. 23 Telephone number editing Order Date Some more CL Programming %SST, *CAT and basic math Database Files Physical files Logical files

%SST - Substring %SST(&FIELDA offset length) CHGVAR &FIELDA VALUE(‘Cindy Laurin-Moogk’) CHGVAR &FNAME VALUE(%SST(FIELDA 1 5)) CHGVAR &LNAME VALUE(%SST(FIELDA 7 6)) CHGVAR &NEWNAME VALUE(&FNAME *BCAT &LNAME)

Concatenate *CAT – Puts two character strings together as is the receiving string variable has to be declared with the combined length else truncation will occur. *BCAT – Puts two character strings together by deleting the trailing spaces in the first field, inserting a blank space and then adding the second field *TCAT – Puts two character strings together by deleting the trailing spaces in the first field.

Concatenate Examples DCL FLDA *CHAR 10 VALUE(‘CINDY’) DCL FLDB *CHAR 30 VALUE(‘LAURIN) DCL FLDC *CHAR 50 VALUE(‘ ‘) CHGVAR FLDC VALUE(FLDA *CAT FLDB) CHGVAR FLDC VALUE(FLDA *TCAT FLDB) CHGVAR FLDC VALUE (FLDA *BCAT FLDB)

CHGVAR - Math DCL &TOTAL *DEC LEN(7 2) DCL &FLDA *DEC LEN(5 0) VALUE(10) DCL &FLDB *DEC LEN(5 0) VALUE(2) DCL &FLDC *DEC LEN(5 0) VALUE(60) CHGVAR &TOTAL (&FLDA * &FLDA / + (&FLDA - &FLDB) + &FLDC) What is the value of &total?

SUBSTRING program

Database Files

iSeries Database Files Physical Files *FILE PF-DTA Logical Files *FILE LF Physical files contain actual data. Logical files show a view of a physical file (I.e. different key field and selection criteria). A logical file does not contain data. Printer files determine how a spool file will be displayed (I.e. fonts, characters per inch etc.) Display files determine how screens such as menus, information and data entry screens well look.

Physical Files It is an iSeries file used to store data or source code. Physical files have members. The members contain data or source code. Source physical files have many members eg. One for each program Data physical files usually have 1 member (but can have more)

Data Files Files, Records, Fields A file member contains one or more records A record is made up of one or more fields which give it its record format or file description Each field contains a unique piece of information e.g. student no, first name, last name, address, telephone no, etc. Looks like a spreadsheet with rows and columns (rows = records, columns = fields)

Examples of Files, Records, Fields A customer file is made up of customer records (1 per customer). Each customer record has fields containing unique pieces of info about a particular customer e.g. customer name, address, sales territory,billing info, shipping instructions, credit information Student file - student records (1 per student)- student info: name, address...

More Examples of Files, Records, Fields Parts file - parts records - info about part: part number, description, warehouse location, supplier, quantity on hand, Payroll file - payroll records - payroll info for employees: employee number, name, date of hire, hourly or salary, hourly rate or annual salary, income tax info….

How do we create data physical files?

Creating Physical Data Files Creating an iSeries data file is very similar to creating a program: Write the source code (the source code will describe what the file will look like). The source code is stored in a member in a source file. Compile the source code (this creates a *file object).

Tools for Describing Database Files Data Description Specifications (DDS) iSeries language to create source code for Files Others: SQL (Structured Query Language) – next week DDS is the most popular. Can use utilities SDA (screen design aid) to create DDS screen files and RLU (report layout utility) to create DDS report files.

Using DDS Source code is entered into a source physical file member in the form of DDS statements. This is done using the iSeries editor LPEX The DDS statements describe each field of the record in detail e.g. field name, data type (numeric, character, packed numeric, etc), standard column headings, etc. The source file for DDS is QDDSSRC. Can edit all kinds of DDS files including screen and printer DDS files.

Layout of a Data Definition Specification member (DDS) File level keywords Eg. UNIQUE Record format name Shouldn’t be the same name as the PF List the fields Name, type, size and functions TEXT (used by DFU and DSPFFD) COLHDG (used by Query/400) Access Path information

Example of DDS Columns . . . : 1 71 Browse DMENKEN/QDDSSRC SEU==> STUPF FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++ *************** Beginning of data ************************************* 0001.00 UNIQUE 0002.00 A R STUPFR 0003.00 A SOCINS 9S 0 COLHDG('Social' 'Insurance' 0004.00 A FNAME 15A COLHDG('First' 'Name') 0005.00 A LNAME 20A COLHDG('Last' 'Name') 0006.00 PHONE 10P COLHDG('Phone' 'No.') 0007.00 A ADDR1 25A COLHDG('Street' 'Address') 0008.00 A ADDR2 25A COLHDG('City') 0009.00 A POSTAL 6A COLHDG(‘Postal Code') DTEHIRE L COLHDG(‘Date’ ‘Hired’) K SOCINS ****************** End of data ****************************************

Creating a Physical File Create the source file (CRTSRCPF) which is named QDDSSRC (only done once) Create a source member, type PF Enter the source code using SEU Save source code and compile to create the file Put code into the file.

The source type: tells OS/400 what type of source you are creating e.g. TXT, PF, LF, etc. Used by the editor for prompting and syntax checking will tell OS/400 which compiler to use when creating the object.

Entering DDS code First statement is the Record Format statement. Put an R in the Name Type field and the record name in the Name field. Then enter the field info (field name, length, data type, decimal positions, standard column heading) (nothing in Name Type field)

Demo

Compiling the Source members Code into an usable object CRTPF Takes the source code and creates the object i.e. the physical file the physical file is what holds the data

Unique feature of iSeries Files The record description is stored with the file object (externally described file) It can then be used by iSeries utilities The record description does not have to be coded in programs that use it. Can be viewed using DSPFD, DSPFFD

Entering data If the compile was successful, you will have a new object in your library, a physical file. To enter data into that file, use DFU, Data File Utility

DFU STRDFU, then option 5 or… PDM option 18 F10 to enter new records (entry mode) F11 to change records (change mode), page up and down to find records F23 to delete a record (F23 again to confirm)

Viewing records RUNQRY QRYFILE(filename) DSPPFM filename

Allows us to sort or select/omit data Access Paths Allows us to sort or select/omit data

Logical Files

Logical Files Resort data in a physical file Select/Omit specific sets of data Hide data Join or Merge physical files together

Why a logical file A customer file is made up of customer records (1 per customer). Each customer record has fields containing unique pieces of info about a particular customer e.g. customer name, address, sales territory,billing info, shipping instructions, credit information If we want to make sure that the customer id is unique If we want to display customer records sorted by name If we want to select customers in a specific territory If we want to provide a maintenance screen hiding Credit Information

Creating a Logical File Create the source file (CRTSRCPF) which is named QDDSSRC (only done once) Create a source member, type LF Enter the source code using SEU Save source code and compile to create the file Put data into the file.

Create a logical file that sorts STUDENTS by LNAME, FNAME

Next Week Programming with Database files