Skills for the RPG Programmer Reskilling the RPG

  • Slides: 50
Download presentation
Skills for the RPG Programmer Re-skilling the RPG Programmer © 2001 Com. Con

Skills for the RPG Programmer Re-skilling the RPG Programmer © 2001 Com. Con

WEBCAST SCHEDULE Today’s event will run one-hour long. Here are the expected times for

WEBCAST SCHEDULE Today’s event will run one-hour long. Here are the expected times for each segment of the webcast: • : 00 – : 05: Moderator introduces the speaker and discusses the details of the Webcast. • : 05 - : 35: Speaker delivers a Power. Point presentation on the webcast topic. • : 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 the presentation screen. © 2001 Com. Con

TECHNICAL FAQs Here answers to the most common technical problems users encounter during a

TECHNICAL FAQs Here answers to the most common technical problems users encounter during a webcast: Q: Why can’t 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 is referring to. What should I do? A: The slides are constantly be pushed to your screen. You’ll should refresh (hit F 5) to view the latest slide. If your question is still not answered, please click the “Ask a Question” button at the bottom of your screen and submit your problem. A technical support person will respond immediately. You can also visit the Broadcast Help page for more information or to test your browser compatibility: http: //help. yahoo. com/help/bcst/ © 2001 Com. Con

Skills for the RPG Programmer Re-skilling the RPG Programmer © 2001 Com. Con

Skills for the RPG Programmer Re-skilling the RPG Programmer © 2001 Com. Con

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

Agenda Skills for what? Why do you need to re-skill? l What has changed? l What Are The First Steps? Know your system. l Know your database. l Use The Right Tools for the Job. l Get to Grips with RPG IV and ILE. l Find Out about Event-Driven Programming. l Learn the basics of HTML and Javascript. l Then What? HTML, Javascript and CGI. l Visualage RPG l Java l Web. Sphere whatever. l © 2001 Com. Con

The times they are a changing. . . . Java Web. Sphere ILE RPG

The times they are a changing. . . . Java Web. Sphere ILE RPG IV Web. Facing HTML/CGI © 2001 Com. Con

Premise You are not using third-party tools There are many Great third-party tools out

Premise You are not using third-party tools There are many Great third-party tools out there. Ø I will mention some later. l Maybe you should be using one of them!!!! l All You Have is Web. Sphere Development Toolset (V 5 R 1) or Web. Sphere Development Studio Client (V 5 R 1/V 5 R 2)! Application Development Toolset (ADTS). l Web. Sphere Development Tools for i. Series. l –Code/400 (Editor, Designer, Project Manager). –Distributed Debugger – Web. Sphere Studio – Web. Facing Tool –Visual. Age for RPG. Visual. Age for Java l ALL of the compilers for OS/400 l –RPG, Cobol, C, Java, etc. © 2001 Com. Con

Where to Start? There a few things you need to look into before you

Where to Start? There a few things you need to look into before you enhance your programming skills. Become familiar with the IFS (Integrated File System) l Become familiar with i. Series Navigator (Operations Navigator) l –Especially the IFS and Database. l Grasp the basics of SQL –You can do this from i. Series Navigator without Interactive SQL. –SQL is slowly(? ) replacing DDS. Find out about triggers. l Find out about referential integrity. l © 2001 Com. Con

Use i. Series Navigator is the GUI interface for OS/400 Navigator is getting the

Use i. Series Navigator is the GUI interface for OS/400 Navigator is getting the development dollars – Green Screen is not! l Navigator is part of the “free” portion of i. Series Access. l Have a look at Basic Operations to get a feel for how it works. l Become familiar with the IFS (Integrated File System) l Become familiar with the Databases. l © 2001 Com. Con

Explore the IFS i. Series supports multiple file systems – not just QSYS! Root

Explore the IFS i. Series supports multiple file systems – not just QSYS! Root - PC style l QOpen. Sys - Unix style l QDLS - Shared Folders l QSYS. LIB - Traditional OS/400 l QOPT - Optical Storage l QNTC - Windows NT Servers l And more…… l © 2001 Com. Con

Explore Databases This is the new interface for Database functions l Have a look

Explore Databases This is the new interface for Database functions l Have a look at how tables/views and indexes are created © 2001 Com. Con

Creating a Table This is not DDS! l Navigator offers a “friendly” interface to

Creating a Table This is not DDS! l Navigator offers a “friendly” interface to SQL’s Data Definition Language (DDL) © 2001 Com. Con

Database Navigator will give you a diagram of your Database! l Just a little

Database Navigator will give you a diagram of your Database! l Just a little bit easier then DSPFD and DSPFFD! © 2001 Com. Con

SQL Get to grips with SQL. It is becoming the standard for maintaining the

SQL Get to grips with SQL. It is becoming the standard for maintaining the database. l SQL is being developed - DDS is not. l © 2001 Com. Con

Triggers and Referential Integrity Triggers Programs that are called when a row (record) is

Triggers and Referential Integrity Triggers Programs that are called when a row (record) is inserted, updated or deleted. l An excellent means of applying business rules. l Referential Integrity l 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 all corresponding Order Details. © 2001 Com. Con

The Choices Green Screen Although everything is heading towards GUI, there is still a

The Choices Green Screen Although everything is heading towards GUI, there is still a place for green screen within applications. l Not everything lends itself to point and click. l GUI Application l Good old Client Server! Browser-based The interface is in a browser. l Fast becoming the most popular. l Easiest to distribute to the Internet. l © 2001 Com. Con

The Right Tools Get with the right tools. SEU/SDA/RLU are NOT up to the

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%!!! © 2001 Com. Con

Code/400 is A customizable editor l Reference manual as help l Navigator l Verifier

Code/400 is A customizable editor l Reference manual as help l Navigator l Verifier l Much, much more l © 2001 Com. Con

Code/400 Editor © 2001 Com. Con

Code/400 Editor © 2001 Com. Con

Code/400 Verifier © 2001 Com. Con

Code/400 Verifier © 2001 Com. Con

Code/400 Help © 2001 Com. Con

Code/400 Help © 2001 Com. Con

Code/400 Navigator © 2001 Com. Con

Code/400 Navigator © 2001 Com. Con

RPG IV Get up to speed with RPG IV If you are still using

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. /FREE D_Pgm. Txt = *Blank; D_Proc = SDSProc. Name; D_Pgm. Txt = 'Work with'; If Show_Paid and Show_Unpaid; D_Pgm. Txt = %trim(D_Pgm. Txt) + ' Paid and Unpaid'; End. If; If Show_Paid and Not Show_Unpaid; D_Pgm. Txt = %trim(D_Pgm. Txt) + ' Paid'; End. If; /END-FREE © 2001 Com. Con

Getting there…… Getting there is easy! CVTRPGSRC IBM supplied conversion tool. l Performs basic

Getting there…… Getting there is easy! CVTRPGSRC IBM supplied conversion tool. l Performs basic syntax conversion. l Convert, Compile, Relax. l Third-party Option If you want more than basic syntax conversion. l If you want code re-engineered to use new features. l Check out the RPGTool. Box from Linoma Software (www. linoma. com) l © 2001 Com. Con

RPG IV Highlights Here you have it -- the brand new RPG! 10 -character

RPG IV Highlights Here you have it -- the brand new RPG! 10 -character external names (files, format and field names). l Allow mixed case. l Allow blank lines. l Introduction of new Definition (D) Specification. l Elimination of Extension (E) and Line Counter (L) Specifications and the practical elimination of Input (I) Specifications. l Re-definition of the Header (H), File (F) and Calculation (C) Specifications. l More powerful array definition and processing. l Prefixing externally defined files. l Date processing and manipulation. l Named Indicators l Introduction of new data types, especially integers and pointers. l Introduction of Built-in Functions (e. g. %SUBST). l Introduction of Subprocedures and other ILE-related features. l Integration with Java. l And, of course, free format. l But perhaps the most important change is that the re-structuring has made RPG even easier to change in the future l © 2001 Com. Con

Subprocedures are the biggest change to RPG - EVER! They provide a means of

Subprocedures are the biggest change to RPG - EVER! They provide a means of encapsulation. Day. Number = Dayof. Week(Input. Date); Err. Inds = Valid. Customer(Customer. Data); If (Get. Customer. Dept(Customer)) = 'A 01'; © 2001 Com. Con

Subprocedures This is what the code looks like. . . . P Day. Of.

Subprocedures This is what the code looks like. . . . P Day. Of. Week D D Inp. Date B PI D ASaturday D Work. Day S S 1 P 0 D D Inz(D'02/13/99') 1 P 0 /FREE Work. Day = %Rem(%Diff(Inp. Date : ASaturday : *D): 7); If Work. Day < 1; Work. Day = Work. Day + 7; End. If; Return Work. Day; /END-FREE P Day. Of. Week E © 2001 Com. Con

ILE Subprocedures lead to Service Programs. You start to look at program design in

ILE Subprocedures lead to Service Programs. You start to look at program design in a different way. Procedure Procedure *Module Procedure *Pgm *Module *Srv. Pgm © 2001 Com. Con

Clients are Event Driven! Client Applications are event driven. Client Applications can be written

Clients are Event Driven! Client Applications are event driven. Client Applications can be written in: Java l Visual Basic l C/C++ l Any PC programming language l Even RPG!!!! l For Visual. Age RPG you need to learn GUI Design l Event Driven l But it is still RPG l © 2001 Com. Con

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

HTML Learn the basics of HTML Easy to learn l Lots of good books. l I liked "HTML for the World Wide Web" by Elizabeth Castro ISBN 0 -201 -35493 -4 l Code/400 is a HTML editor. l <TR><td ALIGN=CENTER VALIGN=TOP WIDTH="404" HEIGHT="186"><font face="Arial">To contact us: <p>Phone: +353 1 282 6230 Fax: +353 1 282 6230 Email: <a href="mailto: tuohyp@comconadvisor. com"> tuohyp@comconadvisor. com</a> <p>5, Oakton Court Ballybrack Co. Dublin Ireland <p>© Com. Con Computer Consultants 2002</font> </td></TR> © 2001 Com. Con

What is CGI ? CGI stands for 'Common Gateway Interface' l It supports the

What is CGI ? CGI stands for 'Common Gateway Interface' l It supports the ability to dynamically build Web pages –It dictates format of the data stream for requests and responses l A standard for communicating between a browser and an HTTP Server is configured to pass specific URLs to CGI scripts Not simply to respond with a pre-built Web page l In our case the "script" will be an RPG IV program l The program generates HTML and passes it to the server l 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) l Java l – Plus ILE COBOL, ILE C++, Rexx and Perl © 2001 Com. Con

Sample of a CGI Web Page © 2001 Com. Con

Sample of a CGI Web Page © 2001 Com. Con

Sample of Code for Previous Page This writes one "detail" line l The HTML

Sample of Code for Previous Page This writes one "detail" line l The HTML code is constructed in the RPG Program. Web. Out = New. Line + '<tr align=right>' + '<td>' + Prod. Cd +'</td>' + '<td align=left>' + Prod. Ds +'</td>' + '<td>' + Cat. Cod + '</td>' + '<td>' + %Char(Lnd. Cst) + '</td>' + '<td>' + %Char(Sell. Pr) + '</td>' + '<td>' + Pr. LOrd. A + '</td>' + '<td>' + No. Days. A +'</td></tr>' Write. Web. Data(Web. Data : Web. Data. Len : APIError) © 2001 Com. Con

"Native" CGI problems The APIs are not as simple as one would like l

"Native" CGI problems The APIs are not as simple as one would like l And the documentation is less than wonderful Generating HTML directly in the program reduces flexibility l 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 l 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 l And it is FREE !! The CGIDEV 2 Library l Available for download at www-922. ibm. com © 2001 Com. Con

Sample from CGIDEV WIth CGIDEV, the HTML is kept separate from (or external to)

Sample from CGIDEV WIth CGIDEV, the HTML is kept separate from (or external to) the RPG Program. : : /$Table. Row <TR ALIGN=RIGHT> <TD /%Prod. Cd%/</TD> <TD ALIGN=LEFT>/%Prod. Ds%/</TD> <TD>/%Cat. Cod%/</TD> <TD>/%Lnd. Cst%/</TD> <TD>/%Sell. Pr%/</TD> <TD>/%Prl. Ord. A%/</TD> <TD>/%No. Days. A%/</TD> </TR> : : © 2001 Com. Con

Code from Previous Sample Coding is MUCH easier with CGIDEV // Load substitution variables

Code from Previous Sample Coding is MUCH easier with CGIDEV // Load substitution variables Upd. HTMLVar('Prod. Cd': Prod. Cd) Upd. HTMLVar('Prod. Ds': Prod. Ds) Upd. HTMLVar('Cat. Cod': Cat. Cod) Upd. HTMLVar('Lnd. Cst': %Char(Lnd. Cst)) Upd. HTMLVar('Sell. Pr': %Char(Sell. Pr)) Upd. HTMLVar('Prl. Ord. A': Prl. Ord. A) Upd. HTMLVar('No. Days. A': No. Days. A) // And add row to table Wrt. Section('Table. Row') © 2001 Com. Con

So Far. . . If you learn RPG IV l Some ILE l Some

So Far. . . If you learn RPG IV l Some ILE l Some HTML l You can be on the Web in No Time! Getting to the Web is Easy!!!!! © 2001 Com. Con

Javascript Extend those HTML capabilities Javascript is NOT full blown Java by any means.

Javascript Extend those HTML capabilities Javascript is NOT full blown Java by any means. <HTML><HEAD><TITLE>Quote of the Day</TITLE> </HEAD><BODY><DIV ALIGN=CENTER><H 1>Quote of the Day</H 1> <HR><FONT COLOR="navy" SIZE="5"> <SCRIPT> <!-var quotes = new Array() quotes[0] = "Every time history repeats itself the price goes. . . quotes[1] = "The moment you think you understand a great work. . . quotes[9] = "So little done, so much to do. . document. write(quotes[Math. round(Math. random()*9)]) // --> </SCRIPT></FONT></DIV></BODY></HTML> © 2001 Com. Con

Web. Facing Time: 8: 05 date: Oct 22, 2000 enter customer number: _____ RPG

Web. Facing Time: 8: 05 date: Oct 22, 2000 enter customer number: _____ RPG Program 0 5 52 P Day. Of. Week B D PI D/Copy 1 P 0 D Work. Date D D Any. Sunday S D INZ(D'1995 -04 -02') D Work. Num S 7 0 D Work. Day S 1 P 0 C Work. Date Sub. Dur Any. Sunday Work. Num : *D C Work. Num Div 7 Work. Num C Mv. R Work. Day C If Work. Day < 1 C Return Work. Day + 7 C Else C Return Work. Day C End. If P Day. Of. Week E Workstation manager ? We b Converts DDS to Servlets and JSPs There is NO change to the RPG Programs © 2001 Com. Con 52 co 50 to nv ers Web ion DOWProto

Web. Sphere Studio © 2001 Com. Con

Web. Sphere Studio © 2001 Com. Con

Web. Sphere Application Server Servlets l Java Server Pages (JSPs) l Enterprise Java Beans

Web. Sphere Application Server Servlets l Java Server Pages (JSPs) l Enterprise Java Beans (EJBs) l Web Browser HTML Application Server HTTP server Any Client, Any Browser EJB Client Admin Console Servlet Engine TCP /IP EJB Container Administrative Server © 2001 Com. Con JDBC RPG Cobol Etc. Data base

And then there is Java Get to grips with OO. . it is very

And then there is Java Get to grips with OO. . it is very different. A good grounding in RPG IV and ILE makes it easier to understand. Set Name & Address Set Balance Get Address A Customer © 2001 Com. Con

Java is an OO language © 2001 Com. Con

Java is an OO language © 2001 Com. Con

Java Code in Code/400 © 2001 Com. Con

Java Code in Code/400 © 2001 Com. Con

A Plan of Action Must Do. . . . Should Do. . . .

A Plan of Action Must Do. . . . Should Do. . . . IFS Code/400 i. Series Navigator SQL RPG IV and ILE HTML and CGI And then Any of. . . . Web. Facing Visual. Age for RPG OO and Java Web. Sphere Studio, Javascript and JSPs Triggers and RI © 2001 Com. Con

The Learning Curve Times are opinion based on the experience of many. l "Practice"

The Learning Curve Times are opinion based on the experience of many. l "Practice" is to a level of proficiency as opposed to expertise. l © 2001 Com. Con

How Long Will It Take? Pick the Route Carefully!!!!!! Course Code/400 RPG IV ILE

How Long Will It Take? Pick the Route Carefully!!!!!! Course Code/400 RPG IV ILE Basic CGIDEV Basic WAS Webfacing Studio OO Java Self Teach Practice 2 5 7 4 2 1 2 3 2 2 3 8 10 10 5 5 10 20 10 80 25 15 20 15 10 100 30 © 2001 Com. Con

The Choice is Yours!! Lay the foundations l IFS, SQL, i. Series Navigator, Triggers,

The Choice is Yours!! Lay the foundations l IFS, SQL, i. Series Navigator, Triggers, Referential Integrity. Take the first step Code/400 l RPG IV and ILE l HTML l CGI l Jump Visual. Age for RPG l Web. Facing l OO and Java l © 2001 Com. Con

Some References "Who Knew You Could Do That With RPG IV? " l IBM

Some References "Who Knew You Could Do That With RPG IV? " l IBM Red Book SG 24 -5402 at www. redbooks. ibm. com "Re-Engineering RPG Legacy Applications" l By Paul Tuohy ISBN 1 -58347 -006 -9 at mc-store. com "HTML for the World Wide Web" l By Elizabeth Castro ISBN 0 -201 -35493 -4 "e-RPG - Building AS/400 Web Applications with RPG" l By Brad Stone ISBN 158347 -008 -5 at mc-store. com "Java for RPG Programmers" l By George Farr and Phil Coulthard ISBN 1 -889671 -23 -1 at mc-store. com The CGIDEV 2 web site l www-992. ibm. com The RPG Toolbox l www. linoma. com © 2001 Com. Con

Questions? Submit your questions now by clicking on the “Ask A Question” button in

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. © 2001 Com. Con