Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Spring 2014 CS 230 – Procedural Programming RPG language on IBMi POWER Systems Rick Flagler Adjunct Professor.

Similar presentations


Presentation on theme: "1 Spring 2014 CS 230 – Procedural Programming RPG language on IBMi POWER Systems Rick Flagler Adjunct Professor."— Presentation transcript:

1 1 Spring 2014 CS 230 – Procedural Programming RPG language on IBMi POWER Systems Rick Flagler Adjunct Professor

2 2 Major Concepts of THIS course zUse of RPG, PDM, Rational development tools zUnderstanding of the mechanics of creating and compiling a program zApplication of RPG language to access the built-in DB2 database of IBMi y Native DB access y Embedded SQL statements zRelationships involved in the nature of data and programs

3 3 Level set – where are you in relation to other students and developers? 1- I have never programmed – dont know what it is 2- Ive done some programming – think RPG = Role Playing Games 3- Ive heard of RPG in this context 4- I work in a place using IBMi OS or similar mainframe / programs 5- Ive programmed a lot in other languages 6- I use RPG but want to learn more 7- I could sub for Rick as teacher – just here for easy credit

4 4 Tonights agenda zIntroduce IBMi and Power Hardware zDiscuss history of how this platform came to be and why so popular in business world zDiscuss tools used for programming and administration of system zDiscuss language and Database Access for built-in DB2 database

5 5 Class environment zIBMi – operating system zDB2 database zEmulation = telnet (5250) ySTRPDM command yPDM = Program Development Manager zOperations or i Navigator = Client-server GUI zRational Developer for Power Systems yRdi or RDp Can get these last two products from Lab Monitors Or from Professor

6 6 Tools you might run into when using IBMi server zNavigator yGUI file browser yWork area to create DB2 stuff zRDi yIntegrated Development Environment for iSeries compilers RPG, Java, C, COBOL yDebugger yData Views yEclipse foundatioin with IBMi specific plug-ins zWebsphere Application Server yServer environment for Java Servlets and Web Applications zGreen Screen – Operations console, command line, various server tasks ySTRPDM – launchs editor environment yCALL – runs programs ySBMJOB – submits program calls or commands to batch (background) processing

7 7 Navigator – GUI interface of IBMi formerly Operations Navigator UserID and Password required for server access PIE3.keene.edu

8 8 Navigator - Database Access Database menu allows you to access a LIBRARY, also known by the SQL terms COLLECTION or SCHEMA, and the objects within.

9 9 Integrated File System / root /QDLS – PC-based Document library objects (DLOs) and folders /QFILESVR.400 –access to other file systems residing on remote iSeries /QNTC – local/remote Integrated Netfinity Servers running Windows NT or 2000 /QOPENSYS – UNIX-based files and directories /QOPT – stream files stored on optical media /QSYS.LIB – iSeries libraries and various objects /Mounted-name (NFS) – Any Network File System exported by an NFS server /User-defined file system – contains user-defined/managed file systems File system contains DOS, Windows PC-like file and folders as well as native Objects.

10 10 Navigator - IFS view

11 11 Emulation = Telnet so-called (green screen) zIBMi Access yWindows Versions yEmulation sessions yMapped drives yDatabase access yData transfer yApplication programming interfaces (APIs) - defined set of programming constructs yiNavigator - the GUI of the system

12 12 Client Server development tools zRDi or RDp yRational Developer tools xPart of Eclipse Open Source Consortium yIncludes all typical development tools for mainframe, PC and web areas zPart of the Application Development Toolset for the iSeries yLPEX = Live Parsing Editor Extensible xcross application editor for creating source code for almost any PC or Host-based languages xJava, CL, RPG and COBOL, DDS

13 13 Typical Eclipse or RDi interface Explorer Code Status Rational layout

14 14 Competencies to gain zTo become a successful application developer, you need the following skills: yAnalysis: How to analyze an existing (or proposed) system to identify required objects and processes ySpecification: how to specify system objects and processes in a way that is useful to the end-users and/or implementers yDesign: how to design database files, programs yImplementation: how to code to create objects, DB files, programs etc. yTesting: How to test software at the component and system level yDeployment: How to put programs, databases and software into production use. zThis course will teach some skills in each of these important areas.

15 15 What is a Database? zA database is a set of computer files to store information. zA database management system (DBMS) is the system software enabling computer users to define and update database files. zDB2 or Universal Database (UDB) for i is an integrated part of i5/OS, the operating system of the IBMi. This is different than other platforms where you buy load DB separately. LAN Carbuy.com Server Clients

16 16 Database Object terminology zDatabase zSchema zTable zRow zColumn SchemaA SchemaB Table1 Table2 Row Rows Columns Database

17 17 Database zThe software or hardware that enables you to create objects to store and manipulate data in a computer. zThink of the database as a room full of file cabinets. zSome names and makers of popular database software yDB2 yOracle yMySQL yInformix yDataComm ySQL Server yAccess – Microsoft Office (not a full database but used by many)

18 18 Schema zSchema (aka Library or Collection) – All these terms mean the same thing. A schema is a container where database objects are stored. Different DB software will use various names. IBM used to call it a Library or a Collection and now a Schema yIndustry standards influence the naming yThink of the Schema as a file cabinet yThere can be many schemas created in any database xYou give each schema a unique name in the database Schema

19 19 Table zTable – Often also called a File, the Table is the physical object that is created to hold data and store facts about a specific type of data, the shape of data and access information as well. yMany tables are created in a schema yThink of each Table as a file folder yMany times you will hear Tables referred to as the Database. Schema Table

20 20 Row zRow – The Row holds a set of related facts and is also referred to as a Record. yIn database software, rows are numbered from 1 through however many there are. xUsually there is some theoretical maximum number of rows or records that you probably will not reach. xAn Excel spreadsheet can hold only rows yThink of each Row as a piece of paper in a file folder Schema Table Rows

21 21 Column zColumn – A Column, also called a Field contains one fact. zEach column is assigned a data type. Some of these types are CHARACTER, DATE, TIME, NUMERIC and a host of others. zA Table will always have at least one Column and usually many yIn a good design, one or more columns will uniquely identify a specific row yEach Row in the Table has the same layout of columns xIn other words, the Column definition applies to all Rows in the Table and is defined when the Table is first created. xAs Rows are added or removed from the Table, all columns become available yThink of a Column as a line on a piece of paper Schema Table Rows Columns

22 22 Database processing zPast yAll data resided on one central host yDatabase contained text only yOne sequence for data review at a time ySorting of physical data from one sequence to new sequence when needed zNow yData all over the place – on more than one computer yMultimedia - Sounds, BLOB, CLOB, GIF, JPEG yMany logical sequences provide access simultaneously by different people for differing uses – these are called Index objects

23 23 IBM Computer History z1960s - Mainframe systems ySystem/360 - mainframe z1970s - Small business computers emerge ySystem/3, System/32, System/34, System/36 ySystem/370 - next generation mainframe z1978 System/38 – numerous radical concepts ysingle level storage - everything handled as memory ydevice independence – everything is data yAllowed new hardware with NO SOFTWARE CHANGES – still revolutionary today! z1980s through 1990s - Application System/400 (ie. AS/400) ymerged System/38 and System/36 yhardware reinvented several times since now 64-bit ydouble (or triple) horsepower every year z AS/400e model 8xx - first huge AS/400s z Renamed from AS/400 to iSeries – joined with pSeries, zSeries z2003 – i890, i870 and other i8xx models with new software packaging announced – more powerful/competitive than ever z2004 – IBM announces next generation iSeries and pSeries computers for business and scientific computing – similar architecture, shared hypervisor to allow various operating systems to run in partitions z2008 – IBM combines pSeries/iSeries into POWER Systems such that all systems can run any OS offered (AIX, Linux, IBM i and with external box/internal card Windows) z2009 – IBM announces POWER7 – 7 th generation of high performance chips 5ghz or more z2011- IBM WATSON system beats humans on quiz show "Jeopardy" z2013 –IBM announces POWER 8 – 12 core chip – doubles performance of Power7

24 24 IBM computers – Then and Now circa 1978, this computer was considered small compared to the mainframes! small or large IBM Power System today With 1000s of times the power. Model 520 Under Desk Model 595 Requires Room of its own Link to IBM

25 25 Supersize it! - 64-bits y18,446,744,073,709,551,616 bytes Kilo Mega Giga Tera (2 40 ) Peta (2 50 ) Exa (2 60 ) IBM i address space

26 26 Why is it called IBM i, System i or iSeries? zThe i in stands for: yintegrated – all components packaged together and system tested in Rochester, MN at IBM development laboratory yintegrity – iSeries security is better than most any system available yinnovative – extremely powerful and cutting edge technology yIn a class by itself - compared to all other computing machinery – more Fortune 500/1000 companies use IBMi than any other computing platform

27 27 IBM i Operating System (OS/400) Basics zMenus - system functions organized by menu zCommands - take vowels out of the words to get meaningful commands yExamples: xWork with Active Jobs = WRKACTJOB xDisplay Job = DSPJOB xStart (Programming Development Manager) PDM = STRPDM xCreate Bound RPG Program = CRTBNDRPG xWork with Submitted Jobs = WRKSBMJOB xWork with User Jobs = WRKUSRJOB

28 28 Finding Commands zFunction Keys yF4 to Prompt parameters yF3 to exit a screen/program yF1 for HELP zPartial command names yGO CMDxxx xWhere XXX = ADD, CHG, DSP, WRK, RPG xto locate commands based on subject yPrompting commands at command line xFill in the blanks – ease of use

29 29 Objects zEverything in the OS is an object y80+ object types in OS xPrograms xFiles yObject contains HEADER information and CONTENTS yAccess objects only through COMMANDS Object Contents (program instructions, file data) Header COMMAND Data or object information extracted to display, files or printer Encapsulation Type-specific part of object header Associated space (misc object data)

30 30 Libraries zLibraries are located in the Integrated File System (IFS) yIFS allows OS to support various file systems (Unix, PC, Lib/File) zLibraries are used to organize objects on IBMi yThink of a Library like a Unix or MS-DOS directory or a Windows95 folder. Libraries are not nested like in Windows Explorer xWith one exception (QSYS.LIB) contains other libraries yFiles and Programs live inside Libraries, Library and Object names are 10 alphanumeric characters, Objects are owned by a User Profile Call Program Executable object Program Directory, size etc. Library Data, record layout, etc. File Open File Display Library

31 31 Object types and sub-types zAn object is uniquely identified by the combination of its Qualified Name (Library/Object) and its object type yOS will only allow one object with the name CUSTOMER of the type *FILE in library DATA. yOS will allow another object CUSTOMER of type *PGM in library DATA however but this is NOT a good practice. APMASTER Accounts payable open balances *FILE AP0001 Create Accounts payable total *PGM AP0002 Roll over open balance *PGM *LIB - LB0001 Accounts payable applications APOWNER Owns objects in the AP system *USRPRF

32 32 Files, Record Formats & Members Records Fields RRN = Relative Record (row) number

33 33 Records in Members zEach record occupies a unique position in the file member. Record# 1, 2, 3 ….n zThis is called the Relative Record Number (RRN) zEach physical file has just one record format and all records in every member of the file have the same format zA record is identified as used or deleted. Deleted records can be re-used

34 34 File Description - record format (layout) in DB2 database

35 35 Access Paths - two kinds Arrival or Keyed Sequence Records Fields Arrival sequence – records are numbered from 1 through however many. BUT, if deleted records are reused – arrival is misnomer – why?

36 36 Access Paths - two kinds Arrival or Keyed Sequence Records Fields One or more fields can be the key

37 37 Type of Files - Physical and Logical Logical File - may have fewer fields, reordered fields, changed sizes in addition to key ordering and selection/omission of rows

38 38 Physical file = TABLE zContainer for data zHas one access path by default zCan be Arrival (as inserted) zCan be Keyed (by one of more fields) zAn SQL Table is a physical file in DB2 on the IBMi OS

39 39 Logical file = VIEW or INDEX zFilter for data zHas Keyed access path zCan reorder data zCan select/omit rows zCan include/exclude columns zAn SQL View or SQL Index is a logical file in DB2 on the IBMi OS

40 40 Typical file access - Relationship between physical and logical files Physical File(s) Logical File Higher Level Languages RPG, COBOL, JAVA, SQL File Member

41 41 Creating programs with RPG and files with Data Description Specifications - DDS Text Editors SEU source Entry Utility RDi, RDp, Eclipse, etc. Compiler CRTRPGPGM command CRTPF command Source files Source Member(s) Physical or Logical File member program

42 42 DDS use and formatting zDDS is columnar zDDS uses keywords to describe file features and field attributes zDDS is entered into a source physical file zDDS is compiled to create (CRTxx) a file object UNIQUE R CUSTOMERTEXT(CUSTOMERS) CUSTID7P 0COLHDG(Customer ID) NAME 30ACOLHDG(Customer Name) STATUS 1A COLHDG(Customer Status) SHPA1 30ACOLHDG(Customer Addr line) SHPCITY 30ACOLHDG(Customer City) K CUSTID

43 43 Creating files with Structured Query Language - SQL SQL Development Kit Interactive SQL Operations Navigator SQL interpreter Create Table Create View Create Index Alter Table Comment ON Label ON Table (Physical) or View (Logical) or Index (Logical) member

44 44 SQL use and formatting zSQL is free format and english-like zSQL uses reserved words zSQL commands are entered into an interactive session therefore no compilation step is required Create Table DATA/CUSTOMER (CustIdDec(7,0) not Null, NameChar(30) not Null, ShpA1Char(30), ShpCityChar(30), ShpStateChar(2), StatusChar(1), Primary Key (CustID))

45 45 Creating tables with Operations Navigator Point-click or fill-in-blanks method to create a table from scratch or from other pre-existing table(s).


Download ppt "1 Spring 2014 CS 230 – Procedural Programming RPG language on IBMi POWER Systems Rick Flagler Adjunct Professor."

Similar presentations


Ads by Google