Accessing the AS/400 DATABASE Preparation for DATA storage Create a receptacle (file) internal -- in program or direct (output / crtpf) external -- with.

Slides:



Advertisements
Similar presentations
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
Advertisements

Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
iSeries Database Files
User Query Control An Enhancement For AS/400 Query On The IBM iSeries from  Copyright I/O International, 2005 Skip Intro.
August 29, Accessing the iSeries and Some Commands.
Main Menu F3 Exit = Press F3 to exit this screen. Commonly Use Keys: F4 Prompt = Position cursor in front of ‘?’ location and press F4 to display a list.
Advanced RPG Chapter 8 Interactive Applicatons. Interactive Applications  Batch Processing: Program is run without human intervention or control.  Interactive.
Week # 2 - Agenda Types of AS/400 Objects Qualified/Unqualified Names
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Guide To UNIX Using Linux Third Edition
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 1 1 Microsoft Access 2003 Tutorial 1 – Introduction To Microsoft Access 2003.
1 Intro to the AS/400 Chapter 8 - Data File Utility Copyright 1999 by Janson Industries.
The AS/400 and the printing process
Introduction to Query Part 2. Query Topics Joining Files Defining Result Fields Complex Record Selection Formatting Output Creating Reports Using Multiple.
Chapter 16 - Monitoring Hardware and Jobs
Any Questions!. Agenda Fun with Functions –how to get the system date Condition Names INDARA and SI Iteration Logical Files Positioning the file pointer.
Advanced File Processing
FIRST COURSE Access Tutorial 1 Creating a Database.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
1 Access Lesson 1 Microsoft Access Basics Microsoft Office 2010 Introductory.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch.
Chapter 1 Databases and Database Objects: An Introduction
Mastering the AS/400, Third Edition, author Jerry Fottral 1 Week 2 The System The AS/400 is a multi-user, multi-tasking system -- a system on which many.
Once a physical file has been created, how can data be loaded into it? zDFU zSQL zCopy File zWrite a program.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Microsoft Access Lesson 1 Lexington Technology Center February 11, 2003 Bob Herring On the Web at
® Microsoft Access 2010 Tutorial 1 Creating a Database.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Presentation © Copyright 2002, Bryan Meyers Externally Described Files Chapter 6.
AS/400 Concepts & Tools. Day 1 Introduction to the AS/400 Basic Technical Concepts Programming Environment & Tools Programming Development Manager (PDM)
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Key Applications Module Lesson 21 — Access Essentials
Microsoft Access 2000 Presentation 1 The Basics of Access.
Introduction to Query Part 1. Query Overview Quick Utility Efficient Report Yes! Impress your manager!
Microsoft Access. Microsoft access is a database programs that allows you to store retrieve, analyze and print information. Companies use databases for.
IBC233 Lecture 2 Updated Winter 2008 Agenda Test next Week – Jan 23 ISeries Architecture CL (Control Language) Library Lists Operations Navigator.
AgVantage Software’s Most Commonly Used Queries Lab - Part 2 Presented by: Mike Smark AgVantage National Conference 2010 Presented by: Mike Smark AgVantage.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
ECDL. Word processing Work with documents and save them in different file formats Choose built-in options such as the Help function to enhance productivity.
Week 4 presentation! This week we will cover editing and the use of the on-board tools provided, SEU and PDM.
W6L1ops400.ppt1 Reviews. 2 Notation types? Difference ? Job commands ?Get help with CMD??? Menu What role does the user profile play?What is your job.
BA271 Week 6 Lecture Dave Sullivan. Goal for today… Status Report – Review where we are … Status Report – Review where we are … Begin learning about Microsoft.
Any Questions!. Agenda Fun with Functions –how to get the system date –How to get the next service date INDARA and SI Condition Names Iteration Logical.
Lecture 3 REVIEW of concepts security assistance profiles Library list
Database Objective Demonstrate basic database concepts and functions.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Introduction to Query Part 3. Query Topics Report Breaks  Totals and subtotals Forms of Output  Detail verses summary Output Types  Data base file.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Preparation for and Accessing the AS/400 DATABASE.
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.
Any Questions!. Agenda Fun with Functions Externally Described Files Condition Names Iteration Logical Files Random Reads.
Preparation and Accessing Data on the AS/400 Menus & Security,
1 Welcome! DBT544 students to the iSeries, DB2 Universal Database And SQL interface.
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
Notes: **A Row is considered one Record. **A Column is a Field. A Database is…  an organized set of stored information usually on one topic  a collection.
W1L2ops400.ppt1 Lecture 1 OPS400 AS/400 / iSeries / eSeries Mid-Range Operating System OS/400.
CL Programming with Database Files Updated Summer 2007.
How’s assignment 1 coming? Winter 2007
IBC233 Week 6.
Objects, Libraries, and Library Lists
Chapter 10 Backup and Recovery.
IBC233 Week 2 Updated Winter 2011
Database Fundamentals
IBC233 Week 2 Updated Fall 2011.
IBC233 Week 5.
Presentation transcript:

Accessing the AS/400 DATABASE

Preparation for DATA storage Create a receptacle (file) internal -- in program or direct (output / crtpf) external -- with DDS PDM (strpdm, wrkobjpdm) SEU (strseu) Access to the data programmatically Utilities (dsp cpy chg) DFU Query/400

Source Physical File vs Data Physical File Source Physical File (in between stage, a blueprint)Source Physical File (in between stage, a blueprint) –Layout is fixed: 3 fields programmers can only alter the length of the text fieldprogrammers can only alter the length of the text field –Used to store code Data Physical File (actual object)Data Physical File (actual object) –Layout is determined by Application Designer –Used to store data

Source files - CRTSRCPF Are created only once in a library (container for blueprints) All / each library can contain source physical files Contain zero to many members (specifications) e.g. Programs (PGM) external physical file specification (PF) logical file specifications (LF) display files (DSPF) printer file (PRTF) Default names for specific source types are QCLSRC CLP Programs QCBLSRC COBOL programs QRPGSRC RPG Programs QCSRC C Programs QDDSSRC File specifications for PF, LF, DSPF, PRTF etc.

preparation for source files AS/400 Programming Development Manager (PDM) Select one of the following: 1. Work with libraries 2. Work with objects 3. Work with members : 9. Work with user-defined options PDM provides access to all levels of data storage LIBRARIES File objects (*file) members option 12 will allow “drill down” from the highest to the lowest level

Specify Members to Work With Type choices, press Enter. File qddssrc Name, F4 for list Library aberns *LIBL, *CURLIB, name Member: Name *ALL *ALL, name, *generic* Type *ALL *ALL, type, *generic*, *BLANK Work with Members Using PDM ODIN File QDDSSRC Library.... ABERNS Position to _____________________..... Type options, press Enter. 2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename 8=Display description 9=Save 13=Change text 14=Compile 15=Create module... Opt Member Type Text __ APVENDOR PF In class developed __ ARCUST PF ASSIGNMENT 2 and in class 3/4 __ ARTRANPF PF AR transaction file OPS234 fall 2000 __ ARTRNS PF ASSIGNMENT 2 __ ARTRNSDF DSPF Assignment 2 transaction display file __ ASSG2DSP DSPF

Columns... : 1 71 Edit ABERNS/QDDSSRC SEU==> ARCUST FMT A*.....A* *************** Beginning of data ************************************* A* Physical file ARCUST ACCOUNTS RECEIVABLE Master File A* A UNIQUE A R ARCUSTR A CUSTNO 5S 0 TEXT('CUSTOMER NUMBER') A ALIAS(AR_CUST_NUMBER) A NAME 30A TEXT('CUSTOMER NAME') A ALIAS(AR_CUST_NAME) A SALESMAN 2S 0 TEXT('SALESMAN') A ALIAS(AR_SLSM_NUMBER) A STATUS 1A TEXT('STATUS') A ALIAS(AR_CUST_STATUS ) Source editing for physical files - PF

A* DISPLAY FILE - ARTRNSDF - CUSTOMER TRANSACTION INPUT A* A* SCREEN1 FORMAT TO PROMPT FOR CUSTOMER NUMBER A* A DSPSIZ(24 80 *DS3) A CA03(03 'F3=EXIT') A INDARA A R SCREEN A BLINK A S1DATE 8 0O 1 3ALIAS(SN1_SYS_DATE) A EDTCDE(Y) A 1 25'Customer Transaction Input A DSPATR(RI) A S1PNAME 5A O 1 68ALIAS(SN1_PROG_NAME) A 4 10'CUSTOMER = ' A CUSTNO 5A B 4 35ALIAS(SN1_CUST_NUMBER) A 'DIAGNOSTIC = ' A 10 S1DIAGN 30A O 7 35ALIAS(SN1_DIAGNOSTICS) A 23 2'F3=Exit' A R SCREEN A CF12(12 'F12=NEXT') A S2DATE 8 0O 1 3ALIAS(SN2_SYS_DATE) A EDTCDE(Y) A 1 25'Transaction Capture for' A DSPATR(RI) A S2PNAME 5A O 1 68ALIAS(SN2_PROG_NAME) A 3 10'CUST NO' A DSPATR(HI) A 3 20'NAME' A DSPATR(HI) Source editing for display files - DSPF

: Sequence Number - Help : : : : F?=Show the Select Format display : : Type F? to show the Select Format display. From this display : : choose the format to use. : : : : I=Insert a line : : Type I to insert a blank line after this record. : : : : In=Insert n lines : : Type In to insert n blank lines after this record. : : : : IF=Insert line and display format : : More... : SEU HELP F1 with cursor on sequence number function

File QDDSSRC Library.... ABERNS Position to..... Type options, press Enter. 2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename 8=Display description 9=Save 13=Change text 14=Compile 15=Create module... Opt Member Type Text 14 ARTRNSDF DSPF Assignment 2 transaction display file ASSG2DSP DSPF ASSG3DSP DSPF ASSG3DSPC2 DSPF Create / Generate the object option 14 a executable program a physical file a display (screen) file a report format (regular 8 1/2 x 11 or special forms)

DATA (files) Can come from anywhere disk, tape, screen, communications, internet, e-biz Is managed / created / manipulated by a program or a utility such as DFU or generated by QUERY as output or ??????

Types of Physical Files Flat files - Arrival order only Sequential or Random access onlyFlat files - Arrival order only Sequential or Random access only Keyed / Indexed Files Sequential, Random, Keyed accessKeyed / Indexed Files Sequential, Random, Keyed access

Physical Files using a Key Access a record in a file according to the value of a specific field (the Key Field). ex. You could access a particular student record using the student id as the key rather than read the whole file a record at the time looking for it.Access a record in a file according to the value of a specific field (the Key Field). ex. You could access a particular student record using the student id as the key rather than read the whole file a record at the time looking for it. You specify that a file will have a key when you created / entered the DDS source member for the fileYou specify that a file will have a key when you created / entered the DDS source member for the file

What if we want to access the data in a different way? We can create new access path (‘s) to the data using Logical Files Type LF

Logical Files ‘Logical View’ or ‘Index’ over one or more physical files Refer to physical file(‘s) and can only be created after the Physical file(‘s) exist Do NOT contain data They are an access path into a file by using index key’s from a keyed record to point to a position in the physical file it is based on

What is a Logical File? It is a file which provides another way or view of looking at data in a physical file, i.e. another access path to the data.It is a file which provides another way or view of looking at data in a physical file, i.e. another access path to the data. It does not contain data, the data is stored in the physical file member.It does not contain data, the data is stored in the physical file member. The access path in the logical file acts as an index to the data.The access path in the logical file acts as an index to the data. A logical file is always created over one or more specific PF’sA logical file is always created over one or more specific PF’s

RR#STUDID LASTNAMEFIRSTNAME Physical File - STUDENTS (FIFO sequence) RR#LASTNAME Logical File - STUDENTS by last name Example of a simple logical file with a key of LASTNAME over a physical file that does not have a key.

Entering data If the compile (option14) was successful, you will have a new object in your library, a physical file. (type *FILE Attr. PF)If the compile (option14) was successful, you will have a new object in your library, a physical file. (type *FILE Attr. PF) To enter data into that file. Under program control. Using a systems utility (CPYF etc.) Using DFU, Data File UtilityTo enter data into that file. Under program control. Using a systems utility (CPYF etc.) Using DFU, Data File Utility

Helpful commands DSPOBJD: display object description gives you information such as creation date, change date, owner, etc.DSPOBJD: display object description gives you information such as creation date, change date, owner, etc. DSPFD: display file description gives you information such as file size, record length, number of fields, etc.DSPFD: display file description gives you information such as file size, record length, number of fields, etc. DSPFFD: display file field description displays complete field informationDSPFFD: display file field description displays complete field information

QUERY/400 IBM licensed product provided for free with every OS/400 systemIBM licensed product provided for free with every OS/400 system USED for QUICK screen inquiriesUSED for QUICK screen inquiries On demand ONE OF reportsOn demand ONE OF reports Collect data from various physical files and generate a new format data file or reportCollect data from various physical files and generate a new format data file or report When saved becomes an object of type *QRYDFN definitionWhen saved becomes an object of type *QRYDFN definition

Run Query ( RUNQRY ) Type choices, press Enter. Query Name, *NONE Library *LIBL Name, *LIBL, *CURLIB Query file: File students--- Name, *SAME Library *LIBL Name, *RUNOPT, *LIBL, *CURLIB Member *FIRST Name, *RUNOPT, *FIRST, *LAST + for more values Report output type *RUNOPT *RUNOPT, *DISPLAY... Output form *RUNOPT *RUNOPT, *DETAIL, *SUMMARY Record selection *NO *NO, *YES

Display Report Report width..... : 142 Position to line..... Shift to column Line SOCINS LNAME FNAME ADDR ,110,002 BILBO BAGGINS 345 HAWTHORNE LN ,110,003 KARIKOOL CLAPSADDLE SUNDOWN RD ,110,004 MATILDA TWIDDLEBOTHAM 1812 RIVER RD ,110,001 CHAN CHARLIE HOLLYWOOD BLVD ,110,005 DOWEGER ENGAR LA LANE ,110,006 STEAMS HOT WATER RD ,110,007 MULLIGAN SWINGA HOLE ,110,008 WILSON ACE TENNISCOURT ,110,009 ICECOLD DRINK ARENA ,110,010 RAPTURED PURPLE AIR CENTRE ,110,011 ARROW BOWEN BULLSEYE ,110,012 SHOTPUT IRONBALLS AROUNDCORNER ,110,013 GYMNASTICS ACROBAT RINGALLEY ,110,014 ATHLETIC RUNNER BEN JOHNSON ALLEY ,110,015 RACING HARNESS HORSESTALLS RESULT of QUICK query run

QUERY Query Utilities System: ODIN Select one of the following: Query for AS/ Work with queries 2. Run an existing query 3. Delete a query DB2 for AS/ Start DB2 Query Manager for AS/400 Query management 20. Work with query management forms 21. Work with query management queries 22. Start a query 23. Analyze a Query for AS/400 definition More... Selection or command ===> F3=Exit F4=Prompt F9=Retrieve F12=Cancel F13=Information Assistant F16=AS/400 Main menu. STRQRY

Work with Queries Type choices, press Enter. Option =Create, 2=Change, 3=Copy, 4=Delete 5=Display, 6=Print definition 8=Run in batch, 9=Run Query..???????? Name, F4 for list Library..... ABERNS Name, *LIBL, F4 for list OPTION 1

Define the Query Query : Option..... : CREATE Library.... : ABERNS CCSID : Type options, press Enter. Press F21 to select all. 1=Select Opt Query Definition Option 1 Specify file selections 1 Define result fields 1 Select and sequence fields 1 Select records - Select sort fields - Select collating sequence 1 Specify report column formatting 1 Select report summary functions - Define report breaks 1 Select output type and output form - Specify processing options F3=Exit F5=Report F12=Cancel F13=Layout F18=Files F21=Select all

Specify File Selections Type choices, press Enter. Press F9 to specify an additional file selection. File STUDENTS Name, F4 for list Library AB234MRKA1 Name, *LIBL, F4 for list Member *FIRST Name, *FIRST, F4 for list Format *FIRST Name, *FIRST, F4 for list File ID T01 A-Z99, *ID File SCHOOL Name, F4 for list Library AB234MRKA1 Name, *LIBL, F4 for list Member *FIRST Name, *FIRST, F4 for list Format *FIRST Name, *FIRST, F4 for list File ID *ID A-Z99, *ID File selection

Select Output Type and Output Form Type choices, press Enter. Output type =Display 2=Printer 3=Database file Form of output =Detail 2=Summary only Line wrapping N Y=Yes, N=No Wrapping width Blank, Record on one page N Y=Yes, N=No OUTPUT selection ! REDIRECTION !

The END