Skills for the Rpg Prog 2

  • Upload
    samk5a5

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

  • 7/29/2019 Skills for the Rpg Prog 2

    1/50

    2001 ComCon

    Skills for the RPG Programmer

    ComCon5, Oakton Court

    Ballybrack

    Co. Dublin

    Ireland

    Re-skilling the RPG Programmer

    Phone: +353 1 282 6230

    e-Mail: [email protected]

    Web: www.ComConAdvisor.com

    Paul Tuohy

  • 7/29/2019 Skills for the Rpg Prog 2

    2/50

    WEBCAST SCHEDULE

    Todays event will run one-hour long. Here are the expected times foreach segment of the webcast:

    :00 :05: Moderator introduces the speaker and discusses the detailsof the Webcast.

    :05- :35: Speaker delivers a PowerPoint presentation on the webcasttopic.

    :35- :60: Moderator and speaker engage in a Q&A on the topic.

    You can submit questions to the speaker at any time during the event.Just click on the Ask a Question button at the bottom of thepresentation screen.

  • 7/29/2019 Skills for the Rpg Prog 2

    3/50

    TECHNICAL FAQs

    Here are answers to the most common technical problems users encounter

    during a webcast:

    Q: Why cant I hear the audio part of the webcast?

    A: Try increasing the volume on your computer.

    Q: I just entered the webcast and do not see the slide that the speaker isreferring to. What should I do?

    A: The slides are constantly be pushed to your screen. Youll should refresh(hit F5) to view the latest slide.

    If your question is still not answered, please click the Ask a Questionbutton at the bottom of your screen and submit your problem. A technicalsupport person will respond immediately.

    You can also visit the Broadcast Help page for more information or to testyour browser compatibility: http://help.yahoo.com/help/bcst/

  • 7/29/2019 Skills for the Rpg Prog 2

    4/50

    2001 ComCon

    Skills for the RPG Programmer

    ComCon5, Oakton Court

    Ballybrack

    Co. Dublin

    Ireland

    Re-skilling the RPG Programmer

    Phone: +353 1 282 6230

    e-Mail: [email protected]

    Web: www.ComConAdvisor.com

    Paul Tuohy

  • 7/29/2019 Skills for the Rpg Prog 2

    5/50

    2001 ComCon

    Agenda

    Skills for what? Why do you need to re-skill? What has changed?

    What Are The First Steps? Know your system.

    Know your database.

    Use The Right Tools for the Job. Get to Grips with RPG IV and ILE.

    Find Out about Event-Driven Programming.

    Learn the basics of HTML and Javascript.

    Then What? HTML, Javascript and CGI. Visualage RPG

    Java

    WebSphere whatever.

  • 7/29/2019 Skills for the Rpg Prog 2

    6/50

    2001 ComCon

    The times they are a changing.......

    Java

    WebSphere

    ILEWebFacing

    RPG IV

    HTML/CGI

  • 7/29/2019 Skills for the Rpg Prog 2

    7/50 2001 ComCon

    Premise

    You are not using third-party tools There are many Greatthird-party tools out there.

    I will mention some later.

    Maybe you should be using one of them!!!!

    All You Have is WebSphere Development Toolset (V5R1)

    or WebSphere Development Studio Client (V5R1/V5R2)!Application Development Toolset (ADTS). WebSphere Development Tools for iSeries.

    Code/400 (Editor, Designer, Project Manager).

    Distributed Debugger

    WebSphere Studio

    WebFacing Tool

    VisualAge for RPG. VisualAge for Java

    ALL of the compilers for OS/400RPG, Cobol, C, Java, etc.

  • 7/29/2019 Skills for the Rpg Prog 2

    8/50 2001 ComCon

    Where to Start?

    There are a few things you need to look into before you enhance

    your programming skills. Become familiar with the IFS (Integrated File System)

    Become familiar with iSeries Navigator (Operations Navigator)Especially the IFS and Database.

    Grasp the basics of SQLYou can do this from iSeries Navigator without Interactive SQL.

    SQL is slowly(?) replacing DDS. Find out about triggers.

    Find out about referential integrity.

  • 7/29/2019 Skills for the Rpg Prog 2

    9/50 2001 ComCon

    Use iSeries Navigator

    iSeries Navigator is the GUI interface for OS/400 Navigator is getting the development dollars Green Screen is not! Navigator is part of the free portion of iSeries Access.

    Have a look at Basic Operations to get a feel for how it works.

    Become familiar with the IFS (Integrated File System)

    Become familiar with the Databases.

  • 7/29/2019 Skills for the Rpg Prog 2

    10/50 2001 ComCon

    Explore the IFS

    iSeries supports multiple file systems not just QSYS! Root - PC style QOpenSys - Unix style

    QDLS - Shared Folders

    QSYS.LIB - Traditional OS/400

    QOPT - Optical Storage

    QNTC - Windows NT Servers

    And more

  • 7/29/2019 Skills for the Rpg Prog 2

    11/50

    2001 ComCon

    Explore Databases

    This is the new interface for Database functions Have a look at how tables/views and indexes are created

  • 7/29/2019 Skills for the Rpg Prog 2

    12/50

    2001 ComCon

    Creating a Table

    This is not DDS! Navigator offers a friendly interface to SQLs Data Definition Language (DDL)

  • 7/29/2019 Skills for the Rpg Prog 2

    13/50

    2001 ComCon

    Database Navigator

    Database Navigator will give you a diagram of your Database! Just a little bit easier then DSPFD and DSPFFD!

  • 7/29/2019 Skills for the Rpg Prog 2

    14/50

    2001 ComCon

    SQL

    Get to grips with SQL. It is becoming the standard for maintaining the database. SQL is being developed - DDS is not.

  • 7/29/2019 Skills for the Rpg Prog 2

    15/50

    2001 ComCon

    Triggers and Referential Integrity

    Triggers Programs that are called when a row (record) is inserted, updated or deleted.An excellent means of applying business rules.

    Referential Integrity Define relationships between tables (physical files) e.g.

    You cannot delete a customer if they have outstanding invoices

    When you delete the Order Header record, automatically delete allcorresponding Order Details.

  • 7/29/2019 Skills for the Rpg Prog 2

    16/50

    2001 ComCon

    The Choices

    Green ScreenAlthough everything is heading towards GUI,

    there is still a place for green screen within

    applications.

    Not everything lends itself to point and click.

    GUI Application Good old Client Server!

    Browser-based The interface is in a browser.

    Fast becoming the most popular.

    Easiest to distribute to the Internet.

  • 7/29/2019 Skills for the Rpg Prog 2

    17/50

    2001 ComCon

    The Right Tools

    Get with the right tools.

    SEU/SDA/RLU are NOT up to the job.

    Use of Code/400 can increase productivity by 20% to 40%!!!

  • 7/29/2019 Skills for the Rpg Prog 2

    18/50

    2001 ComCon

    Code/400

    Code/400 isA customizable editor Reference manual as help

    Navigator

    Verifier

    Much, much more

  • 7/29/2019 Skills for the Rpg Prog 2

    19/50

    2001 ComCon

    Code/400 Editor

  • 7/29/2019 Skills for the Rpg Prog 2

    20/50

    2001 ComCon

    Code/400 Verifier

  • 7/29/2019 Skills for the Rpg Prog 2

    21/50

    2001 ComCon

    Code/400 Help

  • 7/29/2019 Skills for the Rpg Prog 2

    22/50

    2001 ComCon

    Code/400 Navigator

  • 7/29/2019 Skills for the Rpg Prog 2

    23/50

    2001 ComCon

    RPG IV

    Get up to speed with RPG IV

    If you are still using RPG III - STOP NOW

    You will start to see gains from RPG IV within a very short period of

    time.

    /FREED_PgmTxt = *Blank;D_Proc = SDSProcName;D_PgmTxt = 'Work with';

    If Show_Paid and Show_Unpaid;D_PgmTxt = %trim(D_PgmTxt) + ' Paid and Unpaid';EndIf;

    If Show_Paid and Not Show_Unpaid;D_PgmTxt = %trim(D_PgmTxt) + ' Paid';

    EndIf;

    /END-FREE

  • 7/29/2019 Skills for the Rpg Prog 2

    24/50

    2001 ComCon

    Getting there

    Getting there is easy!

    CVTRPGSRC IBM supplied conversion tool.

    Performs basic syntax conversion.

    Convert, Compile, Relax.

    Third-party Option If you want more than basic syntax conversion.

    If you want code re-engineered to use new features.

    Check out the RPGToolBox from Linoma Software (www.linoma.com)

  • 7/29/2019 Skills for the Rpg Prog 2

    25/50

    2001 ComCon

    RPG IV Highlights

    Here you have it -- the brand new RPG!

    10-character external names (files, format and field names).Allow mixed case.

    Allow blank lines.

    Introduction of new Definition (D) Specification.

    Elimination of Extension (E) and Line Counter (L) Specifications and the

    practical elimination of Input (I) Specifications.

    Re-definition of the Header (H), File (F) and Calculation (C) Specifications. More powerful array definition and processing.

    Prefixing externally defined files.

    Date processing and manipulation.

    Named Indicators Introduction of new data types, especially integers and pointers.

    Introduction of Built-in Functions (e.g. %SUBST). Introduction of Subprocedures and other ILE-related features.

    Integration with Java.

    And, of course, free format.

    But perhaps the most important change is that the re-structuring has made RPG

    even easier to change in the future

  • 7/29/2019 Skills for the Rpg Prog 2

    26/50

    2001 ComCon

    Subprocedures

    Subprocedures are the biggest change to RPG - EVER!

    They provide a means ofencapsulation.

    DayNumber = DayofWeek(InputDate);

    ErrInds = ValidCustomer(CustomerData);

    If (GetCustomerDept(Customer)) = 'A01';

  • 7/29/2019 Skills for the Rpg Prog 2

    27/50

    2001 ComCon

    Subprocedures

    This is what the code looks like.......

    P DayOfWeek BD PI 1P 0D InpDate D

    D ASaturday S D Inz(D'02/13/99')D WorkDay S 1P 0

    /FREE

    WorkDay = %Rem(%Diff(InpDate : ASaturday : *D): 7);If WorkDay < 1;

    WorkDay = WorkDay + 7;EndIf;

    Return WorkDay;

    /END-FREEP DayOfWeek E

  • 7/29/2019 Skills for the Rpg Prog 2

    28/50

    2001 ComCon

    ILE

    Subprocedures lead to Service Programs.

    You start to look at program design in a different way.

    Procedure

    Procedure

    Procedure

    Procedure

    Procedure

    Procedure

    *Module

    *Module

    *SrvPgm

    Procedure

    Procedure

    *Module

    Procedure

    Procedure

    *Module

    *Pgm

  • 7/29/2019 Skills for the Rpg Prog 2

    29/50

    2001 ComCon

    Clients are Event Driven!

    Client Applications are event driven.

    Client Applications can be written in: Java

    Visual Basic

    C/C++

    Any PC programming language

    Even RPG!!!!

    For VisualAge RPG you need to learn GUI Design

    Event Driven

    But it is still RPG

  • 7/29/2019 Skills for the Rpg Prog 2

    30/50

    2001 ComCon

    HTML

    Learn the basics of HTML Easy to learn Lots of good books.

    I liked "HTML for the World Wide Web" by

    Elizabeth Castro ISBN 0-201-35493-4

    Code/400 is a HTML editor.

    To contact us:

    Phone: +353 1 282 6230
    Fax: +353 1 282 6230
    Email:

    [email protected]

    5, Oakton Court

    Ballybrack
    Co. Dublin
    Ireland

    ComCon Computer Consultants 2002

  • 7/29/2019 Skills for the Rpg Prog 2

    31/50

    2001 ComCon

    CGI stands for 'Common Gateway Interface' It supports the ability to dynamically build Web pages

    It dictates format of the data stream for requests and responses

    A standard for communicating between a browser and an HTTP Server

    Server is configured to pass specific URLs to CGI scripts Not simply to respond with a pre-built Web page

    In our case the "script" will be an RPG IV program

    The program generates HTML and passes it to the server Which then sends it out for display as it would any other page

    CGI programming on the AS/400 is supported by RPG IV (ILE RPG)

    Java Plus ILE COBOL, ILE C, ILE C++, Rexx and Perl

    What is CGI ?

  • 7/29/2019 Skills for the Rpg Prog 2

    32/50

    2001 ComCon

    Sample of a CGI Web Page

  • 7/29/2019 Skills for the Rpg Prog 2

    33/50

    2001 ComCon

    Sample of Code for Previous Page

    WebOut = NewLine+ ''+ '' + ProdCd +''+ ''+ ProdDs +''+ '' + CatCod + ''+ '' + %Char(LndCst) + ''+ '' + %Char(SellPr) + ''+ '' + PrLOrdA + ''+ '' + NoDaysA +''

    WriteWebData(WebData : WebDataLen : APIError)

    This writes one "detail" line The HTML code is constructed in

    the RPG Program.

  • 7/29/2019 Skills for the Rpg Prog 2

    34/50

    2001 ComCon

    "Native" CGI problems

    The APIs are not as simple as one would likeAnd the documentation is less than wonderful

    Generating HTML directly in the program reduces flexibility To change the text, one must change the program

    And it is much more difficult to use HTML editors to design the pages

    It would be nice to have something like DDS That way only the variable content is handled by the program

    But writing such a generalized routine to process HTML text and perform text

    substitution is not a trivial task

    IBM has an answer

    And it is FREE !!

    The CGIDEV2 LibraryAvailable for download at www-922.ibm.com

  • 7/29/2019 Skills for the Rpg Prog 2

    35/50

    2001 ComCon

    Sample from CGIDEV

    : :/$TableRow

  • 7/29/2019 Skills for the Rpg Prog 2

    36/50

  • 7/29/2019 Skills for the Rpg Prog 2

    37/50

    2001 ComCon

    So Far......

    If you learn RPG IV Some ILE

    Some HTML

    You can be on the Web in No Time!

    Getting to the Web is Easy!!!!!

  • 7/29/2019 Skills for the Rpg Prog 2

    38/50

    2001 ComCon

    J avascript

    Extend those HTML capabilities

    Javascript is NOT full blown Java -

    by any means.

    Quote of the DayQuote of the Day

  • 7/29/2019 Skills for the Rpg Prog 2

    39/50

    2001 ComCon

    WebFacing

    DOWProto

    P DayOfWeek B

    D PI D/Copy 1P0D WorkDate D

    D AnySunday S D INZ(D'1995-04-02')

    D WorkNum S 7 0

    D WorkDay S 1P 0

    C WorkDate SubDur AnySunday WorkNum:*DC WorkNum Div 7 WorkNum

    C MvR WorkDay

    C If WorkDay < 1

    C Return WorkDay + 7

    C Else

    C Return WorkDay

    C EndIfP DayOfWeek E

    RPG Programenter customer number:_____

    Time:8:05 date:Oct 22,2000

    ?Workstationmanager

    Converts DDS to Servlets and JSPs

    There is NO change to the RPG Programs

  • 7/29/2019 Skills for the Rpg Prog 2

    40/50

    2001 ComCon

    WebSphere Studio

  • 7/29/2019 Skills for the Rpg Prog 2

    41/50

    2001 ComCon

    WebSphere Application Server

    TCP/IP

    HTTPserver

    Servlet EngineJDBCRPGCobolEtc.

    AdministrativeServer

    Database

    Any Client,

    Any Browser

    HTMLWeb

    Browser

    AdminConsole

    EJB Container

    Application Server

    EJB Client

    Servlets

    Java Server Pages (JSPs) Enterprise Java Beans (EJBs)

  • 7/29/2019 Skills for the Rpg Prog 2

    42/50

    2001 ComCon

    And then there is J ava

    Get to grips with OO.... it is very different.

    A good grounding in RPG IV and ILE makes it easier to understand.

    Get Phone

    Get Address

    Set Balance

    Get Balance

    Get Name

    Get

    Balance

    GetAddress

    Set

    Balance

    Set Name

    & AddressSet

    Balance

    A Customer

  • 7/29/2019 Skills for the Rpg Prog 2

    43/50

  • 7/29/2019 Skills for the Rpg Prog 2

    44/50

  • 7/29/2019 Skills for the Rpg Prog 2

    45/50

    2001 ComCon

    A Plan of Action

    IFS

    iSeries

    Navigator

    SQL

    Triggers and

    RI

    Must Do....... Should Do....... And then Any of.......

    Code/400

    RPG IV and

    ILE

    HTML and

    CGI

    WebFacing

    VisualAge for

    RPG

    OO and Java

    WebSphere

    Studio,

    Javascript

    and JSPs

  • 7/29/2019 Skills for the Rpg Prog 2

    46/50

    2001 ComCon

    The Learning Curve

    0 10 20 30 40 50 60 70 80 90 100

    W ork Days

    Code/400

    RPG IV

    ILE

    Basic CGI

    CGIDEV

    Basic WAS

    Basic W ebfacing

    W ebsphere Studio

    OO

    Java

    Topics

    The Learning Curve

    Course

    Self Teach

    Practice

    Times are opinion based on the experience of many. "Practice" is to a level of proficiency as opposed to expertise.

  • 7/29/2019 Skills for the Rpg Prog 2

    47/50

    2001 ComCon

    How Long Will It Take?

    Pick the Route Carefully!!!!!!

    Course Self Teach Practice

    Code/400 2 5 7

    RPG IV 4 10 10

    ILE 2 10 80

    Basic CGI 1 5 25CGIDEV 2 5 15

    Basic WAS 3 10 20

    Webfacing 2 5 15

    Studio 2 5 10

    OO 3 10 100Java 8 20 30

  • 7/29/2019 Skills for the Rpg Prog 2

    48/50

  • 7/29/2019 Skills for the Rpg Prog 2

    49/50

  • 7/29/2019 Skills for the Rpg Prog 2

    50/50

    Questions?

    Submit your questions now by clicking on the

    Ask A Question button in the left corner

    of your presentation screen.

    Paul will answer your questions

    shortly after the broadcast.