Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Week 1 – CS230 - RPG zRick Flagler zIBM Academic Initiative program zMission – train aspiring CS majors on the IBM Midrange computer technology yThe.

Similar presentations


Presentation on theme: "1 Week 1 – CS230 - RPG zRick Flagler zIBM Academic Initiative program zMission – train aspiring CS majors on the IBM Midrange computer technology yThe."— Presentation transcript:

1 1 Week 1 – CS230 - RPG zRick Flagler zIBM Academic Initiative program zMission – train aspiring CS majors on the IBM Midrange computer technology yThe IBM i operating system yOperations and Navigation yDB2 database yRPG Language You are here

2 2 What you need for this class zCredentials for server – the IBMi system yUserid and Password zComputer yLab access (required) yYour own desktop or laptop ziSeries Access software – available in Lab yServer will have 6.1 but version 5.4 or higher will work y5250 Emulation (aka Telnet) zIBM Rational Developer for i – RDi version 8 – available in Lab zWeb Access to Class website yhttp://Pie3.keene.edu\courses\CS230 yRPG Reference Manual yHomework assignments zThumb Drive zPrinter zCDs of iNav and RDi are available at low cost iSeries Account Thumb Drive Your Computer

3 3 Our approach to learning RPG zLab oriented zWrite a program each week or so zGradually increase complexity Does everyone have a laptop with wireless? Ideal scenario is to work on some in-class projects in classroom

4 4 What is our agenda? zReview RPG language zDiscuss i/OS integration zCommonality with other ILE languages

5 5 What is our agenda? zReview RPG language yEvolution yThe most popular BUSINESS language for IBM computers yThousands of applications written in RPG today yMillions of lines of code ySeveral World-Class ERP systems xJD Edwards/Oracle xMAPICS xMOVEX z i/OS integration yDB2 integration xNative Operation Codes or SQL yMany API interfaces xEasy interface to system function z Commonality with other ILE RPG languages yJava yC yCOBOL yREXX yCL

6 6 Whats it all about – a little history zWhat is RPG? yOriginal Name = Report Program Generator yInvented on mainframe ySpecifically for business yName maybe no longer meaningful but… yStill a very powerful BUSINESS language

7 7 RPG, RPGII, RPG III, RPG IV, ILE RPG, VisualAge RPG – why all this RPG zRPG has had several variations ySeveral still exist ySimilar to COBOL, another popular business language zWe will study most modern version yFree format RPG zSample syntax: –IF (A <= B); – C= C + A; –ELSE; – C = C + B; –ENDIF;

8 8 Current RPG = ILE RPG ILE embraces highly modular programming where main program, modules and service program modules are bound together to form executable programs. In PC development environments OBJ + DLL = EXE – same here. ILE = Integrated Language Environment

9 9 Input – process - output zAll computers and languages fundamentally same zModern RPG is predominantly procedural yLogic is controlled by the programmer yProgram flow can use function keys (interactive), status codes (files) or events (web) to control what happens zModern RPG yDefine Files (input or output) yDefine Calculations (process) yDefine variables, structures, subroutines, procedures, functions, embedded SQL, API calls, Java Method calls

10 10 What can we do with todays RPG? zInteractive applications yInquiry over database yData Entry to database zBatch applications yReports to paper yReports to PDF yReports to web pages yService Oriented Architecture (SOA) – applications interacting with other applications over the Internet zClient Server applications yGUI – web based applications backed by RPG programs yBrowser activated CGI programs yJava Applet thin-client programs (translated from RPG) yRPG called from Web sites via EGL x Enterprise Generation Language – an IBM open source language

11 11 Development cycle zEnter/Change source Code zCompile source to create an object or module z{Bind multiple modules together to create one executable object} zTest zMove from testing to production and use Repeat

12 12 Where is source code stored? zLibrary – A Library is a container for objects zSource Physical File – is a container for multiple source members zSource PF Member – is a container for one piece of source code – member have a type (RPG, RPGLE, CLP) zCompile member to get *PGM object zLibrary/SourceFile(member) zExample: yLibrary = CSXXX yFile = QRPGSRC or QRPGLESRC yMember = MYPGM yType = RPGLE Everyone will have a QRPGSRC file in their library You can store various types of members in any source file. You dont have to use QRPGSRC but could create RickSrc if preferred. IBMs suggested conventions for naming: QRPGSRC, QDDSSRC, QCLSRC, QCBLSRC, QSQLSRC are generally followed.

13 13 Development Source Physical file Source Entry Utility (SEU) Editor Source member 1 Source member 1 Source member 1 Source member 1 Source member 1 Source member 2 Source member 1 Source member 1 Source member 1 Source member 1 Source member 1 Source member 8 Source member 1 Many source members in a single file Each member will correspond to an object or module Each member is complied to create an executable Source FILES typically named for type of source QRPGSRC QCLSRC But could be named APSRC for Accts Payable OESEC for Order Entry source

14 14 How do you edit the source? Various ways! zUse Rational Developer for i suite (RDi) zUse Rational Developer for p suite (RDp) zUse any other editor of choice based on Eclipse frameworks zUse the Program Development Manager - STRPDM command – green screen

15 15 Where do you get these editor applications? zPDM – comes with i/OS and is a standard command yStart PDM – STRPDM xThe STRPDM lets you choose to work with Libraries, Objects or Members. xOption 3 – Members - prompts you for library, source file and then presents a list of source members to work with xAllows you to create a new source member yPDM has a number of standard options to allow you to: x Edit (2), Copy (3), Delete (4), Display (5), Print (6), Rename (7), Compile (14), Call program ( C ) Demo PDM Here

16 16 Where do you get these editor applications - continued? zRational Developer (IBMi or P) yare Client-side applications yfrom IBM xBased on Open-source Eclipse project xAt least one license comes with OS – more cost $800ea approximately yInterface is robust xSource code management xSQL object creation xIBM and User-written plug-in support ySuperset of PDM xAllows you to create a new source member standard options to allow you to: xEdit, Copy, Delete, xDisplay, Print, Rename, Compile xmuch, much more Demo RDi Here Rationals RDi is lightweight Eclipse software -------------------- Requires less machine Starts faster Easy to use

17 17 Elements of RPG language zRPG was always specification oriented zSpecifications are different TYPES of statements that are used for various functions: yH-spec – header/program-wide options yF-spec – definition of files yI-spec – used for file layouts yD-spec – definition of variables yC-spec – logic, math, file i/o actions yO-spec – definition of report fields C-Specs are entered in FIXED or FREE format FREE format is more readable and more popular

18 18 A very simple RPG program for your homework A simple three line program: *************************** * Program: HELLO * Date: todays date * Author: your name here * Function: Demonstrate a very simple RPG program * that tells the user it ran and then ends * * Mod History: * date initials change log * MM/DD/YYYY REF Added a second line of output *************************** // comment – show hello Dsply Hello to {your name here}; Dsply at KSC; // tell program to terminate at return *INLR = *ON; Banner Documentation using comment lines Lines of code in free format

19 19 How you write the code zYou have declarations of Variables and then you have Code. Each has a format. zPDM and WDSC KNOW these formats yEditors offer fill-in-blanks entry – press F4 yEditors offer context sensitive help (press F1) zFast – Accurate – Easy ySome declarations are still FIXED format but with next version, they will be FREE format too, like the procedural code.

20 20 Homework for next week or the following week (lab dependant) zLocate RPG Reference manual PDF on web for ILE RPG 6.1 or 7.1 zGet your account established on IBMi Server zCreate your first program like that pictured on slide 18 above yGet familiar with PDM and SEU commands zWrite the program free format RPG zCompile the program zRun the program


Download ppt "1 Week 1 – CS230 - RPG zRick Flagler zIBM Academic Initiative program zMission – train aspiring CS majors on the IBM Midrange computer technology yThe."

Similar presentations


Ads by Google