from strdbg to wdsc rdi - gateway/400 · 2011-08-26 · and set process date to current date parse...

27
1 Copyright Central Park Data Systems, Inc. Copyright Central Park Data Systems, Inc. 1 Charles Guarino The Art of Debugging: From STRDBG to RDi / WDSc Central Park Data Systems, Inc. Copyright Central Park Data Systems, Inc. Copyright Central Park Data Systems, Inc. 2 With an IT career spanning over 25 years, Charles Guarino has With an IT career spanning over 25 years, Charles Guarino has been a consultant for most of them. Since 1995 he has been been a consultant for most of them. Since 1995 he has been founder and President of Central Park Data Systems, Inc., a founder and President of Central Park Data Systems, Inc., a Long Island based IBM midrange consulting company. He has Long Island based IBM midrange consulting company. He has published several technical and strategic articles, served as a published several technical and strategic articles, served as a member of member of AS/400 Management Magazine’s Editorial Review Editorial Review Board, and has received recognition as a COMMON Speaker of Board, and has received recognition as a COMMON Speaker of Merit. More recently, he was the featured speaker for a Merit. More recently, he was the featured speaker for a COMMON webcast and iSociety.com Fireside Chat on “RPG and COMMON webcast and iSociety.com Fireside Chat on “RPG and XML: Using Web Services and XML Documents”. He was XML: Using Web Services and XML Documents”. He was inducted into COMMON’s Speaker Excellence Hall of Fame at inducted into COMMON’s Speaker Excellence Hall of Fame at the 2008 Spring Conference. Charles is currently a COMMON the 2008 Spring Conference. Charles is currently a COMMON Application Development Subject Matter Expert and a Board Application Development Subject Matter Expert and a Board Member of LISUG, a Long Island IBM System i Users Group. Member of LISUG, a Long Island IBM System i Users Group. Charles can be reached at [email protected]. Charles can be reached at [email protected]. About the presenter: About the presenter:

Upload: others

Post on 29-Mar-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

1

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 11

Charles Guarino

The Art of Debugging:From STRDBG to RDi / WDSc

Central Park Data Systems, Inc.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 22

With an IT career spanning over 25 years, Charles Guarino has With an IT career spanning over 25 years, Charles Guarino has been a consultant for most of them. Since 1995 he has been been a consultant for most of them. Since 1995 he has been founder and President of Central Park Data Systems, Inc., a founder and President of Central Park Data Systems, Inc., a Long Island based IBM midrange consulting company. He has Long Island based IBM midrange consulting company. He has published several technical and strategic articles, served as a published several technical and strategic articles, served as a member of member of AS/400 Management Magazine’s Editorial Review Editorial Review Board, and has received recognition as a COMMON Speaker of Board, and has received recognition as a COMMON Speaker of Merit. More recently, he was the featured speaker for a Merit. More recently, he was the featured speaker for a COMMON webcast and iSociety.com Fireside Chat on “RPG and COMMON webcast and iSociety.com Fireside Chat on “RPG and XML: Using Web Services and XML Documents”. He was XML: Using Web Services and XML Documents”. He was inducted into COMMON’s Speaker Excellence Hall of Fame at inducted into COMMON’s Speaker Excellence Hall of Fame at the 2008 Spring Conference. Charles is currently a COMMON the 2008 Spring Conference. Charles is currently a COMMON Application Development Subject Matter Expert and a Board Application Development Subject Matter Expert and a Board Member of LISUG, a Long Island IBM System i Users Group. Member of LISUG, a Long Island IBM System i Users Group. Charles can be reached at [email protected] can be reached at [email protected].

About the presenter:About the presenter:

Page 2: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

2

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 33

Many of the techniques discussed here require Many of the techniques discussed here require *PGMR authority or higher. I encourage you *PGMR authority or higher. I encourage you to learn more about commands you are not to learn more about commands you are not familiar with before attempting to use them!familiar with before attempting to use them!

Legal disclaimer, brought to you by my attorney!Legal disclaimer, brought to you by my attorney!

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 44

New Terms and Concepts

1.1. WDSC vs. RDi (search for RDi D03HCLL)WDSC vs. RDi (search for RDi D03HCLL)

2.2. Passport AdvantagePassport Advantage

3.3. RDi 60 Day Trial, can be downloadedRDi 60 Day Trial, can be downloaded

4.4. IBM Installation ManagerIBM Installation Manager

5.5. Activation KitActivation Kit

Page 3: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

3

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 55

Passport Advantage, can download RDi w/12 months supportPassport Advantage, can download RDi w/12 months support

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 66

Download full production version for 60 daysDownload full production version for 60 days

Page 4: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

4

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 77

IBM Installation Manager

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 88

Immediately after installation:Immediately after installation:

Page 5: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

5

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 99

What exactly happens after 60 days if you don’t What exactly happens after 60 days if you don’t

enter a permanent license key?enter a permanent license key?

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1010

Importing an Activation Kit:Importing an Activation Kit:

Page 6: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

6

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1111

Connection to System i

You can have multiple You can have multiple

connections to the same connections to the same

system, each one with its system, each one with its

own runtime environment, own runtime environment,

such as library list, job such as library list, job

descriptions and filters. descriptions and filters.

New Terms and ConceptsNew Terms and Concepts

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1212

Right click on connection name and this screen appearsRight click on connection name and this screen appears

Page 7: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

7

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1313

New Terms and Concepts

Perspective:

Groups common tasks to facilitate development and testingGroups common tasks to facilitate development and testing

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1414

Debug perspective: A first look: A first look

Page 8: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

8

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1515

A A FILTERFILTER helps you limit your view to certain objectshelps you limit your view to certain objects

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1616

From this…From this… To this…

Page 9: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

9

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1717

New Terms and ConceptsDebug Server: Turns on the ‘listening’ for RDi debugging jobs: Turns on the ‘listening’ for RDi debugging jobs

on the System i.on the System i.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1818

New Terms and ConceptsService Entry Point: The new approach to placing a program

into debug mode. This places RDi into ‘listening’ mode.

Page 10: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

10

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 1919

New Terms and ConceptsShow in Table: Displays the contents of any “resource”

in a table

Right click on any Right click on any

resource and this windowresource and this window

will be displayed.will be displayed.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2020

This table shows the objects in library XMLLIB.This table shows the objects in library XMLLIB.

This table shows the data records in file SAXDATA.This table shows the data records in file SAXDATA.This is the This is the RDiRDi equivalent to ‘DSPPFM SAXDATA’.equivalent to ‘DSPPFM SAXDATA’.

Page 11: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

11

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2121

New Terms and ConceptsVisualize Application Diagram: Creates and displays a

graphical representation of all associated objects

Note: HTTPAPIR4 andQP0LLIB1 are serviceprograms used from main program WEATHERSCN.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2222

New Terms and ConceptsLPEX: Live Parsing Extensible editor

Page 12: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

12

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2323

OK, let’s debug a program!OK, let’s debug a program!

XML Document sample2.xml

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2424

Sax parsing document control fileSax parsing document control file

Logical file, selects only unprocessed records (date = *Logical file, selects only unprocessed records (date = *lovalloval))

Some processed records:Some processed records:

Page 13: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

13

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2525

Read an unprocessed record from control file SAXCTLRead an unprocessed record from control file SAXCTL

(process date = ‘0001(process date = ‘0001--0101--01’, low value)01’, low value)

If %eof, shut down programIf %eof, shut down program

Delete any old records that exist for this document Delete any old records that exist for this document

Build path to document which resides in IFSBuild path to document which resides in IFS

Update control record flag as processed ‘X’ or error ‘E’Update control record flag as processed ‘X’ or error ‘E’

and set process date to current dateand set process date to current date

Parse the document, write document’s XML dataParse the document, write document’s XML data

segments to physical file SAXDATAsegments to physical file SAXDATA

Read more control records from file SAXCTLRead more control records from file SAXCTL

Basic RPG Program FlowBasic RPG Program Flow

Start program

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2626

Portion of RPGLE program SAXPARSE:Portion of RPGLE program SAXPARSE:

Page 14: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

14

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2727

There are TWO methods to start the debugger:

1)Service Entry Point (S.E.P.).

When the program is run anywhere with

the given parameters, the debugger will start.

2) Launching the debugger directly from RDi

(with or without prompting)

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2828

Method 1: Service Entry PointWe want to bring up the debugger the next time this program is executed.We want to bring up the debugger the next time this program is executed.Remember, the debug server must be active for Remember, the debug server must be active for RDiRDi to communicate with the to communicate with the System System ii..

This is done on the SOURCE member!

Page 15: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

15

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 2929

The Set Service Entry Point prompt appears.Any of the values can be overridden. This is the equivalent to “STRDBG SAXPARSE”.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3030

Need to start the IBM i Debug Server!

Can start through RDi or a green screen command.

1)

)

2)

- OR -

Page 16: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

16

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3131

The debug server runs in subsystems QSYSWRK and QUSRWRK, The debug server runs in subsystems QSYSWRK and QUSRWRK, as jobs Q5BROUTE and Q5BROUTER, respectively.as jobs Q5BROUTE and Q5BROUTER, respectively.

The Debug Server:

Only needs to be started once. Will service ALL requests for ALL users.

Recommendation – start the Debug Server in your system startup job!Use command STRDBGSVR.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3232

Repeated the last sequence with the debug server now

active and received this message:

RDi responds with the following. The next time RPGLE

program SAXPARSE is called, the RDi debugger will

automatically start.

This screen is equivalent to F14 “Work with Module List”

Page 17: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

17

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3333

Here is where preferences are made for each connection

Update production files are just one of the preferences that can be set for this connection.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3434

By selecting prompt you can pass parameters, update production files…

When setting the SEP from the object level, you can also launch

the program.

Page 18: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

18

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3535

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3636

With the debug server active and the service entry point set, the debug perspective ‘wakes up’ when the batch job becomes active.

Call Stack

Page 19: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

19

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3737

Call Stack comparison

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3838

Requesting to display the job log

Page 20: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

20

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 3939

The job log being displayed

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4040

Key features to note:

F6, F8 in RDi = F10 and F12 in STRDBG

Light blue line indicates current line of execution

Shortcuts!

Available views:

Breakpoints

Monitors

Outline

Variables

Note: Each view will open

Another tab on top.

Current line of execution

Page 21: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

21

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4141

Variables View: Change any variable’s value by right clicking on it.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4242

Hovering!

XMLDOC = /xmldocs/sample2.xml

Instead of typing “Eval xmldoc”, simply position the mouse over any variable and its contents will be displayed on the screen.

Page 22: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

22

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4343

The outline view summarizes all of the program information

into one convenient spot.

Click on any “+” to show additional information.

Outline View:

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4444

Breakpoints!

This is the symbol for a breakpoint. Breakpoints can be set before or during program execution.

Page 23: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

23

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4545

Conditional breakpoints:

These are the default values.They tell the system how many times to use this breakpoint.

Will break when field ‘event’ = 21

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4646

Watch breakpoints

Page 24: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

24

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4747

Every time the value of field ‘xmldoc’ changes,program execution will stop.

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4848

When the value in field ‘xmldoc’ changes, display this window.

Page 25: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

25

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 4949

Monitoring variables:A real time display, will change colors when the variable’s value changes, and also displays a delta sign next to the variable’s name

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 5050

Before:

After:

Monitor view

Page 26: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

26

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 5151

Debugging another user’s active job:

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 5252

Page 27: From STRDBG to WDSC RDi - Gateway/400 · 2011-08-26 · and set process date to current date Parse the document, write document’s XML data ... The next time RPGLE program SAXPARSE

27

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 5353

What we covered today:•• How to order and install RDiHow to order and install RDi

•• New terms and concepts:New terms and concepts:•• ConnectionsConnections•• PerspectivesPerspectives•• FiltersFilters•• Debug ServerDebug Server•• Service Entry PointsService Entry Points•• LPEXLPEX

• Using the Debug Perspective• Using the different debug views• Setting up breakpoints• Setting Watch Breakpoints• Using Different Views• Hovering Over Variables• Batch vs. Interactive Jobs• Debugging Another User’s Job

Copyright Central Park Data Systems, Inc.Copyright Central Park Data Systems, Inc. 5454

Charles Guarino

The Art of Debugging:

From STRDBG to RDi

Central Park Data Systems, Inc.Central Park Data Systems, Inc.

Thank You!!!!!Thank You!!!!!

[email protected]