working with traces… walter f. blood technical director, focus division june, 2009

40
Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Upload: victoria-gladys-anderson

Post on 17-Dec-2015

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with Traces…

Walter F. Blood

Technical Director, FOCUS Division

June, 2009

Page 2: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with Traces Agenda

When and Why? Levels of TracingFOCUS Code LevelEngine/Database LevelTypical ScenariosAdditional Uses

Page 3: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen and Why

When will you need to work with traces?You don’t get the results you expectYour old report stops working in a new releaseYou get a FOCUS error message – FOCnnnYour report never comes back.Your systems person calls you to complain about your

activity.FOCUS abends or you get a -12 from the server.

Page 4: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen and Why

What can you expect?To get the report working nowTo find a workaround for the problem if necessaryTo have the problem fixed by IBI if required

Page 5: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

The Key Questions1. Is the machine plugged in?

2. What is the first sign of trouble?

3. What is actually happening?

Page 6: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

1. Is the machine plugged in?Check the obvious— Spelling and punctuation File existence FILEDEFs or ALLOCations Interface availability Security issues Sink Machine/FDS availability

Tracing needed? ….

Page 7: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

TABLE FILE CARPRINT COUNTRY CAR MODEL ANDCOMPUTE SALES='$ ' | EDIT(SALES,'999$');END

TABLE FILE CARPRINT COUNTRY CAR MODEL ANDCOMPUTE SALES='$ ' | EDIT(SALES,'999$');END

TABLE FILE CARPRINT COUNTRY CAR MODEL ANDCOMPUTE SALES='$ ' | EDIT(SALES,'999$');END> ERROR AT OR NEAR LINE 3 IN PROCEDURE DBG1 FOCEXEC(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: SALES(FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND>

TABLE FILE CARPRINT COUNTRY CAR MODEL ANDCOMPUTE SALES='$ ' | EDIT(SALES,'999$');END> ERROR AT OR NEAR LINE 3 IN PROCEDURE DBG1 FOCEXEC(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: SALES(FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND>

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message

Check description to determine nature of problem

Tracing probably not needed

Page 8: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messages

SET ECHO ON;DEFINE FILE CARCONTINENT/A4=IF COUNTRY = FRANCE OR ENGLAND OR ITALY OR 'W GERMANY' THEN EUROPE ELSE ASIA;PROFIT/D12.2CML%=RETAIL_COST - DEALER_COST / DEALER_COST*100;ENDTABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITBY CONTINENTBY COUNTRYON TABLE HOLD AS HOLDCAR FORMAT FOCUS INDEX COUNTRYEND-RUNTABLE FILE ABCHOLDPRINT SALES PROFIT BY CONTINENTEND

SET ECHO ON;DEFINE FILE CARCONTINENT/A4=IF COUNTRY = FRANCE OR ENGLAND OR ITALY OR 'W GERMANY' THEN EUROPE ELSE ASIA;PROFIT/D12.2CML%=RETAIL_COST - DEALER_COST / DEALER_COST*100;ENDTABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITBY CONTINENTBY COUNTRYON TABLE HOLD AS HOLDCAR FORMAT FOCUS INDEX COUNTRYEND-RUNTABLE FILE ABCHOLDPRINT SALES PROFIT BY CONTINENTEND

Page 9: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

> (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: ECHO ON; ERROR AT OR NEAR LINE 3 IN PROCEDURE DBG2 FOCEXEC(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: FRANCE ERROR AT OR NEAR LINE 5 IN PROCEDURE DBG2 FOCEXEC(FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE: D12.2CML% ERROR AT OR NEAR LINE 8 IN PROCEDURE DBG2 FOCEXEC(FOC003) THE FIELDNAME IS NOT RECOGNIZED: PROFIT BYPASSING TO END OF COMMAND(FOC009) INCOMPLETE REQUEST STATEMENTERROR AT OR NEAR LINE 14 IN PROCEDURE DBG2 FOCEXEC(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: ABCHOLD(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: ABCHOLD BYPASSING TO END OF COMMAND

> (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: ECHO ON; ERROR AT OR NEAR LINE 3 IN PROCEDURE DBG2 FOCEXEC(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: FRANCE ERROR AT OR NEAR LINE 5 IN PROCEDURE DBG2 FOCEXEC(FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE: D12.2CML% ERROR AT OR NEAR LINE 8 IN PROCEDURE DBG2 FOCEXEC(FOC003) THE FIELDNAME IS NOT RECOGNIZED: PROFIT BYPASSING TO END OF COMMAND(FOC009) INCOMPLETE REQUEST STATEMENTERROR AT OR NEAR LINE 14 IN PROCEDURE DBG2 FOCEXEC(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: ABCHOLD(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: ABCHOLD BYPASSING TO END OF COMMAND

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messages

FOCUS errors compoundSolve the earliest exposed problem first!

Tracing may be helpful

Page 10: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messagesIncorrect or unexpected results

Work backwards from incorrect resultsLook for

Logic errorsIncorrect assumptionsFOCUS errors

Page 11: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messagesIncorrect or unexpected results

PAGE 1

COUNTRY RETAIL_COST DEALER_COST PROFITMARGIN ------- ----------- ----------- ------------ ENGLAND 45,319 37,853 78 FRANCE 5,610 4,631 21 ITALY 51,065 41,235 88 JAPAN 6,478 5,512 35 W GERMANY 64,732 54,563 115

PAGE 1

COUNTRY RETAIL_COST DEALER_COST PROFITMARGIN ------- ----------- ----------- ------------ ENGLAND 45,319 37,853 78 FRANCE 5,610 4,631 21 ITALY 51,065 41,235 88 JAPAN 6,478 5,512 35 W GERMANY 64,732 54,563 115

DEFINE FILE CARPROFITMARGIN/D7=((RETAIL_COST - DEALER_COST)/DEALER_COST)*100;ENDTABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITMARGINBY COUNTRYEND

DEFINE FILE CARPROFITMARGIN/D7=((RETAIL_COST - DEALER_COST)/DEALER_COST)*100;ENDTABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITMARGINBY COUNTRYEND

Page 12: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messagesIncorrect or unexpected results

TABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITMARGINCOMPUTE PM/D7=((RETAIL_COST - DEALER_COST)/DEALER_COST)*100;BY COUNTRYEND

TABLE FILE CARSUM RETAIL_COST DEALER_COST PROFITMARGINCOMPUTE PM/D7=((RETAIL_COST - DEALER_COST)/DEALER_COST)*100;BY COUNTRYEND

PAGE 1

COUNTRY RETAIL_COST DEALER_COST PM------- ----------- ----------- --ENGLAND 45,319 37,853 20FRANCE 5,610 4,631 21ITALY 51,065 41,235 24JAPAN 6,478 5,512 18W GERMANY 64,732 54,563 19

PAGE 1

COUNTRY RETAIL_COST DEALER_COST PM------- ----------- ----------- --ENGLAND 45,319 37,853 20FRANCE 5,610 4,631 21ITALY 51,065 41,235 24JAPAN 6,478 5,512 18W GERMANY 64,732 54,563 19Tracing will be helpful

Page 13: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message Multiple FOCUS error messagesIncorrect resultsAbend

Traces help identify FOCUS errorsDumps may be required

Tracing required!

Page 14: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesWhen to Trace

2. What is the first sign of trouble?FOCUS error message

Check description to determine nature of problemMultiple FOCUS error messages

FOCUS errors compoundSolve the earliest exposed problem first!

Incorrect resultsWork backwards from incorrect resultsLook for FOCUS errors

Abend Traces help identify FOCUS errorsDumps may be required

Page 15: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces-Dialogue Manager

3. What is actually happening? In Dialogue Manager:

Use -SET &ECHO, -SET &STACK and SET DEFECHO to expose the actual flow of commands

SET DEFECHO – Set the default value of &ECHO

&ECHO=ON - Display FOCUS commands stacked & substituted

&ECHO=ALL - Display FOCUS command stacked & substituted and Dialogue Manager commands

&STACK=OFF – Prevent execution of the stacked FOCUS commands and system variables to test just the Dialogue Manager flow

NOTE: ENCRYPTION prevents ECHO

SET DEFECHO – Set the default value of &ECHO

&ECHO=ON - Display FOCUS commands stacked & substituted

&ECHO=ALL - Display FOCUS command stacked & substituted and Dialogue Manager commands

&STACK=OFF – Prevent execution of the stacked FOCUS commands and system variables to test just the Dialogue Manager flow

NOTE: ENCRYPTION prevents ECHO

SET DEFECHO=ALL-SET &ECHO=ALL…EX pgm2

SET DEFECHO=ALL-SET &ECHO=ALL…EX pgm2

Page 16: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces-Dialogue Manager

3. What is actually happening? In Dialogue Manager:

Use SET &ECHO and SET DEFECHO to expose the actual flow of commands

Use –TYPE to expose local and global variables

-DEFAULT &TEST = OFF

SET PRINTPLUS = ON

-RUN

-? SET PRINTPLUS &PRINTPLUS

-SET &EVT = IF TEST EQ ‘OFF’ THEN ‘*’ ELSE ‘TYPE’;

-&EVT.EVAL VALUE OF PRINTPLUS IS &PRINTPLUS

-DEFAULT &TEST = OFF

SET PRINTPLUS = ON

-RUN

-? SET PRINTPLUS &PRINTPLUS

-SET &EVT = IF TEST EQ ‘OFF’ THEN ‘*’ ELSE ‘TYPE’;

-&EVT.EVAL VALUE OF PRINTPLUS IS &PRINTPLUS

Page 17: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces - TABLE

3. What is actually happening? In TABLE:

Use LET NOPRINT = ; to show complete requestUse SET DEFECHO to show variable substitutionUse –TYPE to expose system variable values

LET NOPRINT = ;TABLE FILE CARSUM RETAIL_COSTBY COUNTRY NOPRINT…

LET NOPRINT = ;TABLE FILE CARSUM RETAIL_COSTBY COUNTRY NOPRINT…

SET DEFECHO=ALLTABLE FILE CARSUM …WHERE COUNTRY EQ &VAR1…

SET DEFECHO=ALLTABLE FILE CARSUM …WHERE COUNTRY EQ &VAR1…

TABLE FILE CAR…END-RUN-TYPE RECORDS &RECORDS

TABLE FILE CAR…END-RUN-TYPE RECORDS &RECORDS

Page 18: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces - MODIFY

3. What is actually happening? In MODIFY:

Use MODIFY FILE xxx TRACE to locate CASE

MODIFY FILE EMPLOYEE TRACEFIXFORM FROM……CASE BADNAME….CASE HIGHSAL…CASE AT STARTDATAEND

MODIFY FILE EMPLOYEE TRACEFIXFORM FROM……CASE BADNAME….CASE HIGHSAL…CASE AT STARTDATAEND

**** START OF TRACE ****TRACE ===> AT CASE TOPDATA FOR TRANSACTION 1EMP_ID => 112847612CURR_SAL => 67000TRACE ===> AT CASE HIGHSALYOU ENTERED A SALARY ABOVE $50000…

**** START OF TRACE ****TRACE ===> AT CASE TOPDATA FOR TRANSACTION 1EMP_ID => 112847612CURR_SAL => 67000TRACE ===> AT CASE HIGHSALYOU ENTERED A SALARY ABOVE $50000…

Page 19: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces - MODIFY

3. What is actually happening? In MODIFY:

Use MODIFY FILE xxx TRACE to locate CASE Use TYPE in CASE xxx to indicate position inside case

TYPE Notes:ON <ddname> - to file, max 256 charactersEmbed field values using spotmarkersAT START - capture initial state of dataAT END - capture final state of dataCan be issued conditionally with MATCH,NEXT,VALIDATE

TYPE Notes:ON <ddname> - to file, max 256 charactersEmbed field values using spotmarkersAT START - capture initial state of dataAT END - capture final state of dataCan be issued conditionally with MATCH,NEXT,VALIDATE

MODIFY FILE EMPLOYEECASE ONETYPE “IN CASE ONE” MATCH EMP_ID TYPE “AFTER MATCH”ON MATCH UPDATE CURR_SALON MATCH TYPE“UPDATED VALUE <T.CURR_SAL”…

MODIFY FILE EMPLOYEECASE ONETYPE “IN CASE ONE” MATCH EMP_ID TYPE “AFTER MATCH”ON MATCH UPDATE CURR_SALON MATCH TYPE“UPDATED VALUE <T.CURR_SAL”…

Page 20: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces – SQL Translator

3. What is actually happening?In SQL Translator:

Use ECHO to show the generated FOCUS code

SQLSELECT BODYTYPE, AVG(MPG), SUM(SALES)FROM CARWHERE RETAIL_COST > 5000GROUP BY BODYTYPE;ECHOTABLEEND

SQLSELECT BODYTYPE, AVG(MPG), SUM(SALES)FROM CARWHERE RETAIL_COST > 5000GROUP BY BODYTYPE;ECHOTABLEEND

> SET COUNTWIDTH=ON-SET SQLERRNUM = 0;TABLE FILE CARWRITE MIN.BODYTYPE AS 'BODYTYPE' AVE.MPG SUM.SALES BY BODYTYPE NOPRINT WHERE ( RETAIL_COST GT 5000 ) ;ON TABLE SET CARTESIAN ONON TABLE SET ASNAMES ONON TABLE SET HOLDLIST PRINTONLYEND-RUN

> SET COUNTWIDTH=ON-SET SQLERRNUM = 0;TABLE FILE CARWRITE MIN.BODYTYPE AS 'BODYTYPE' AVE.MPG SUM.SALES BY BODYTYPE NOPRINT WHERE ( RETAIL_COST GT 5000 ) ;ON TABLE SET CARTESIAN ONON TABLE SET ASNAMES ONON TABLE SET HOLDLIST PRINTONLYEND-RUN

Page 21: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesFOCUS Level Traces – SQL Translator

3. What is actually happening?In SQL Translator:

Use ECHO to show the generate FOCUS code Use FILE nnn to create focexec with FOCUS code

SQLSELECT BODYTYPE, AVG(MPG), SUM(SALES)FROM CARWHERE RETAIL_COST > 5000GROUP BY BODYTYPE;FILE SQLTRAN1TABLEEND

SQLSELECT BODYTYPE, AVG(MPG), SUM(SALES)FROM CARWHERE RETAIL_COST > 5000GROUP BY BODYTYPE;FILE SQLTRAN1TABLEEND

SET COUNTWIDTH=ON-SET SQLERRNUM = 0;TABLE FILE CARWRITE MIN.BODYTYPE AS 'BODYTYPE' AVE.MPG SUM.SALES BY BODYTYPE NOPRINT WHERE ( RETAIL_COST GT 5000 ) ;ON TABLE SET CARTESIAN ONON TABLE SET ASNAMES ONON TABLE SET HOLDLIST PRINTONLYEND-RUN

SET COUNTWIDTH=ON-SET SQLERRNUM = 0;TABLE FILE CARWRITE MIN.BODYTYPE AS 'BODYTYPE' AVE.MPG SUM.SALES BY BODYTYPE NOPRINT WHERE ( RETAIL_COST GT 5000 ) ;ON TABLE SET CARTESIAN ONON TABLE SET ASNAMES ONON TABLE SET HOLDLIST PRINTONLYEND-RUN

Page 22: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening?With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data access

SET XRETRIEVAL=OFFTABLE FILE DB2FILESUM RETAIL_COST DEALER COSTBY COUNTRY WHERE SALES GT 5000END

SET XRETRIEVAL=OFFTABLE FILE DB2FILESUM RETAIL_COST DEALER COSTBY COUNTRY WHERE SALES GT 5000END

...RETRIEVAL KILLED NUMBER OF RECORDS IN TABLE= 0 LINES= 0

...RETRIEVAL KILLED NUMBER OF RECORDS IN TABLE= 0 LINES= 0

Page 23: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening? With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

SET TRACEUSER=ONSET TRACEUSER=ON

ON – Turn traces onOFF – Turn traces off<filename> - Turn traces on and place in this file-------------------------------------------------------------------On command line or in any profile or focexec

Page 24: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening?With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

SET TRACEUSER=ONSET TRACESIZE=number

SET TRACEUSER=ONSET TRACESIZE=number

number – maximum number of lines in trace file----------------------------------------------------------------- Must be placed in focexec – IBITRACE Output to .trc file, overflow to .trb file, then reuse .trc file

Page 25: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening? With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

SET TRACEUSER=ONSET TRACESIZE=numberSET TRACEON=ALL

SET TRACEUSER=ONSET TRACESIZE=numberSET TRACEON=ALL

ALL – Turn on traces for all areasArea – Turn on trace for specific area onlyOFF – Turn on traces for no areas – used as

clear----------------------------------------------------------------- Issue on command line or in focexec or profile

Page 26: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening? With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

SET TRACEUSER=ONSET TRACESIZE=numberSET TRACEON=ALLSET TRACEOFF=ALL

SET TRACEUSER=ONSET TRACESIZE=numberSET TRACEON=ALLSET TRACEOFF=ALL

ALL – Turn on traces for all areasArea – Turn on trace for specific area only----------------------------------------------------------------- On command line or in focexec or profile ALL acts as CLEAR

Page 27: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening?With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

Default Components – as set in Web ConsoleR1H – Platform specific routinesQOPSYS – Generic operating system functionsPRH – Internal read and write routinesNWH – Network and communication routinesNLS – National Language support

Default Components – as set in Web ConsoleR1H – Platform specific routinesQOPSYS – Generic operating system functionsPRH – Internal read and write routinesNWH – Network and communication routinesNLS – National Language support

Page 28: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening? With Interfaces:

Use SET XRETRIEVAL=OFF to suppress data accessUse Dynamic Traces to expose interface activity

Typical Components – available in Web ConsoleCEH – command inputNWH2 – command output PRH – MFD and FOCEXEC read and write routinesSQLAGGR - Data adapter-to-RDBMS aggregation

& join analysis STMTRACE - SQL generated by the data adapter, Direct SQL Passthru

Typical Components – available in Web ConsoleCEH – command inputNWH2 – command output PRH – MFD and FOCEXEC read and write routinesSQLAGGR - Data adapter-to-RDBMS aggregation

& join analysis STMTRACE - SQL generated by the data adapter, Direct SQL Passthru

Page 29: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening?

Special Components for - SQL TRANSLATOR - SQLTRANS SQL DATA ADAPTERS - SQLDI, SQLAGGRREPORT SERVICES

TABH – TABLE servicesWHOPT – WHERE optimizerCMPDEF – Compiled DEFINESSTYLED – Styling

NLS SERVICES - NLS SMART MODE - GKE MAINTAIN

MNTSTMT – Statement traceMNTPERF – Statement trace and performance MNTDBMS – Database trace

Special Components for - SQL TRANSLATOR - SQLTRANS SQL DATA ADAPTERS - SQLDI, SQLAGGRREPORT SERVICES

TABH – TABLE servicesWHOPT – WHERE optimizerCMPDEF – Compiled DEFINESSTYLED – Styling

NLS SERVICES - NLS SMART MODE - GKE MAINTAIN

MNTSTMT – Statement traceMNTPERF – Statement trace and performance MNTDBMS – Database trace

Page 30: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesEngine/Database Level Traces

3. What is actually happening?

Special Components for - Legacy Data Adapters

VSAM – VSAM interfaceFOC – FOCUS interfaceADBSIN – ADABAS interfaceIMS – IMS interfaceIDMSR – IDMS interfaceM204IN – M204 interfaceDATACOM – Datacom interface

XFOCUS Traces – XFOCUS, XFOCH

Special Components for - Legacy Data Adapters

VSAM – VSAM interfaceFOC – FOCUS interfaceADBSIN – ADABAS interfaceIMS – IMS interfaceIDMSR – IDMS interfaceM204IN – M204 interfaceDATACOM – Datacom interface

XFOCUS Traces – XFOCUS, XFOCH

Page 31: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios Exposing the underlying FOCUS code Complex request generation with –INCLUDE, EX and &’s

SET TRACEUSER=ON SET TRACEOFF=ALL SET TRACEON=CEH//FSTRACE SET TRACEUSER=test.trc

SET TRACEUSER=ON SET TRACEOFF=ALL SET TRACEON=CEH//FSTRACE SET TRACEUSER=test.trc

TABLE FILE CARPRINT COUNTRYEND

TABLE FILE CARPRINT COUNTRYEND

11.34.23 AB cepop:: 0, 00080 "TABLE FILE CAR" 11.34.23 AB cepop:: 0, 00080 "PRINT COUNTRY" 11.34.23 AB cepop:: 0, 00080 "END"

11.34.23 AB cepop:: 0, 00080 "TABLE FILE CAR" 11.34.23 AB cepop:: 0, 00080 "PRINT COUNTRY" 11.34.23 AB cepop:: 0, 00080 "END"

Page 32: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios Determining which files are being used Masters, Access files, data files – multiple copies

SET TRACEUSER=ON SET TRACEON=ALLSET TRACEUSER=test.trc

SET TRACEUSER=ON SET TRACEON=ALLSET TRACEUSER=test.trc

13.55.01 AS ioherrop: open name = "FILTRHOLD" 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS r1pathnm: result is <D:\ibi\64bit\srv76\wfs\edatemp\ts000001\filtrhold.mas> 13.55.01 AS r1fopen: calling fopen( D:\ibi\64bit\srv76\wfs\edatemp\ts000001\filtrhold.mas, r ) 13.55.01 AS r1fopen: fopen failed 13.55.01 AS r1trcerr: r1fopen: err#2, The system cannot find the file specified. 13.55.01 AS r1trcerr: iohfopen: err#2, The system cannot find the file specified. 13.55.01 AS ioherrop: name = "FILTRHOLD", : failed to open 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=REMOVE 13.55.01 AS iohfnam: __free: new usage count 1 13.55.01 AS ioherrop: open name = "@0000000" 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=CREATE 13.55.01 AS iohfnam: __main: new usage count: 2

13.55.01 AS ioherrop: open name = "FILTRHOLD" 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=QUERY 13.55.01 AS r1pathnm: result is <D:\ibi\64bit\srv76\wfs\edatemp\ts000001\filtrhold.mas> 13.55.01 AS r1fopen: calling fopen( D:\ibi\64bit\srv76\wfs\edatemp\ts000001\filtrhold.mas, r ) 13.55.01 AS r1fopen: fopen failed 13.55.01 AS r1trcerr: r1fopen: err#2, The system cannot find the file specified. 13.55.01 AS r1trcerr: iohfopen: err#2, The system cannot find the file specified. 13.55.01 AS ioherrop: name = "FILTRHOLD", : failed to open 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=REMOVE 13.55.01 AS iohfnam: __free: new usage count 1 13.55.01 AS ioherrop: open name = "@0000000" 13.55.01 AS iohfnam: __main: called for fname="@0000000" funcode=CREATE 13.55.01 AS iohfnam: __main: new usage count: 2

Page 33: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

13.54.03 AS ngptRcvT: entered 13.54.03 AS iPipeApt: entered 13.54.03 AS iPipeApt: ConnectNamedPipe, 997, Overlapped I/O operation is in progress. 13.54.03 AS ngptRcvT: accepted new connection, receiving communication type 13.54.03 AS iRecvTye: entered 13.54.03 AS ngptRcvT: socket connection request, type=0 13.54.03 AS ngptRcvT: connection etype=0 13.54.03 AS ngptRcvT: cth len = 179 13.54.03 AS iRecvSok: entered 13.54.03 AS iRecvSok: sent PID 13.54.03 AS iRecvSok: received socket info, sending confirmation 13.54.03 AS ngptRcvT: socket successfully received 13.54.03 AI nwnget: entered 13.54.03 AI nwnget: receiving from client

13.54.03 AS ngptRcvT: entered 13.54.03 AS iPipeApt: entered 13.54.03 AS iPipeApt: ConnectNamedPipe, 997, Overlapped I/O operation is in progress. 13.54.03 AS ngptRcvT: accepted new connection, receiving communication type 13.54.03 AS iRecvTye: entered 13.54.03 AS ngptRcvT: socket connection request, type=0 13.54.03 AS ngptRcvT: connection etype=0 13.54.03 AS ngptRcvT: cth len = 179 13.54.03 AS iRecvSok: entered 13.54.03 AS iRecvSok: sent PID 13.54.03 AS iRecvSok: received socket info, sending confirmation 13.54.03 AS ngptRcvT: socket successfully received 13.54.03 AI nwnget: entered 13.54.03 AI nwnget: receiving from client

Working with TracesTypical scenarios

4. Typical scenarios Locate all of the FOCUS error messages Abend often preceded by multiple FOCUS errors

SET TRACEUSER=ON SET TRACEON=ALL SET TRACEUSER=test.trc

SET TRACEUSER=ON SET TRACEON=ALL SET TRACEUSER=test.trc

EX focexecEX focexec

Search file for “FOC”

Page 34: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenariosWork with interface traces …

FILENAME=abctraining, SUFFIX=SQLMSS , $SEGMENT=ABCEMPDATA, SEGTYPE=S0,$FIELDNAME=PIN, ALIAS=PIN, USAGE=A9, ACTUAL=A9, $ FIELDNAME=LASTNAME, ALIAS=LASTNAME, USAGE=A15, ACTUAL=A15, $FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, USAGE=A10, ACTUAL=A10, $ .. DEFINE NEW_PIN/A9 WITH ABCEMPDATA.PIN='000567890'; $DEFINE STATE/A6 WITH ABCEMPDATA.PIN= IF ABCEMPDATA.PIN EQ ‘000567890' THEN ‘NJ' ELSE IF ABCEMPDATA.PIN EQ ‘000456780' THEN ‘NY' ELSE 'XX'; $ SEGMENT=ABCTRAINING, SEGTYPE=S0, PARENT=ABCEMPDATA, CRJOINTYPE=INNER, $FIELDNAME=PIN, ALIAS=PIN, USAGE=A9, ACTUAL=A9, $ FIELDNAME=COURSECODE, ALIAS=COURSECODE, USAGE=A7, ACTUAL=A7, $ FIELDNAME=COURSESTART, ALIAS=COURSESTART, USAGE=HYYMDs, ACTUAL=HYYMDs, $

FILENAME=abctraining, SUFFIX=SQLMSS , $SEGMENT=ABCEMPDATA, SEGTYPE=S0,$FIELDNAME=PIN, ALIAS=PIN, USAGE=A9, ACTUAL=A9, $ FIELDNAME=LASTNAME, ALIAS=LASTNAME, USAGE=A15, ACTUAL=A15, $FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, USAGE=A10, ACTUAL=A10, $ .. DEFINE NEW_PIN/A9 WITH ABCEMPDATA.PIN='000567890'; $DEFINE STATE/A6 WITH ABCEMPDATA.PIN= IF ABCEMPDATA.PIN EQ ‘000567890' THEN ‘NJ' ELSE IF ABCEMPDATA.PIN EQ ‘000456780' THEN ‘NY' ELSE 'XX'; $ SEGMENT=ABCTRAINING, SEGTYPE=S0, PARENT=ABCEMPDATA, CRJOINTYPE=INNER, $FIELDNAME=PIN, ALIAS=PIN, USAGE=A9, ACTUAL=A9, $ FIELDNAME=COURSECODE, ALIAS=COURSECODE, USAGE=A7, ACTUAL=A7, $ FIELDNAME=COURSESTART, ALIAS=COURSESTART, USAGE=HYYMDs, ACTUAL=HYYMDs, $

ENGINE SQLMSS SET OPTIMIZATION SQLTABLE FILE ABCTRAININGPRINT LOCATION LASTNAME FIRSTNAME COURSESTART ... END

ENGINE SQLMSS SET OPTIMIZATION SQLTABLE FILE ABCTRAININGPRINT LOCATION LASTNAME FIRSTNAME COURSESTART ... END

SET TRACEUSER=CLIENTSET TRACEOFF=ALL SET TRACEON=STMTRACESET TRACEON=SQLAGGR

SET TRACEUSER=CLIENTSET TRACEOFF=ALL SET TRACEON=STMTRACESET TRACEON=SQLAGGR

Page 35: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios… to ensure request optimization

16.07.33 BR (FOC2510) FOCUS-MANAGED JOIN SELECTED FOR FOLLOWING REASON(S): 16.07.33 BR (FOC2511) DISABLED BY USER 16.07.33 BR (FOC2598) FOCUS IF/WHERE TEST CANNOT BE PASSED TO SQL : ODS_PAYME 16.07.33 BR (FOC2590) AGGREGATION NOT DONE FOR THE FOLLOWING REASON: 16.07.33 BR (FOC2592) RDBMS-MANAGED JOIN HAS BEEN DISABLED 16.07.33 AE SELECT T1."ODS_PAYMENTECH_D1_TX_DATE", 16.07.33 AE T1."ODS_PAYMENTECH_D1_CARD_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_BH_TERM_NUM",T1."ODS_PAYMENTECH_D1_CARD_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_AUTH_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_TX_SEQ_NUM",T1."ODS_PAYMENTECH_D1_TX_AMT", 16.07.33 AE T1."ODS_STOR_CODE",T1."ODS_PAYMENTECH_BH_BATCH_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_RECORD_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_D1_TX_CODE",T1."ODS_PAYMENTECH_D1_VOID_FLAG", 16.07.33 AE T1."ODS_PAYMENTECH_D2_AUTH_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_D3_ENTRY_DATA_SOURCE", 16.07.33 AE T1."ODS_PAYMENTECH_D4_RETAIL_INDUSTRY_DATA" FROM 16.07.33 AE VODS_ODS_PAYMENTECH T1 WHERE 16.07.33 AE (T1."ODS_PAYMENTECH_D1_RECORD_TYPE" <> '3'); …

16.07.33 BR (FOC2510) FOCUS-MANAGED JOIN SELECTED FOR FOLLOWING REASON(S): 16.07.33 BR (FOC2511) DISABLED BY USER 16.07.33 BR (FOC2598) FOCUS IF/WHERE TEST CANNOT BE PASSED TO SQL : ODS_PAYME 16.07.33 BR (FOC2590) AGGREGATION NOT DONE FOR THE FOLLOWING REASON: 16.07.33 BR (FOC2592) RDBMS-MANAGED JOIN HAS BEEN DISABLED 16.07.33 AE SELECT T1."ODS_PAYMENTECH_D1_TX_DATE", 16.07.33 AE T1."ODS_PAYMENTECH_D1_CARD_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_BH_TERM_NUM",T1."ODS_PAYMENTECH_D1_CARD_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_AUTH_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_TX_SEQ_NUM",T1."ODS_PAYMENTECH_D1_TX_AMT", 16.07.33 AE T1."ODS_STOR_CODE",T1."ODS_PAYMENTECH_BH_BATCH_NUM", 16.07.33 AE T1."ODS_PAYMENTECH_D1_RECORD_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_D1_TX_CODE",T1."ODS_PAYMENTECH_D1_VOID_FLAG", 16.07.33 AE T1."ODS_PAYMENTECH_D2_AUTH_TYPE", 16.07.33 AE T1."ODS_PAYMENTECH_D3_ENTRY_DATA_SOURCE", 16.07.33 AE T1."ODS_PAYMENTECH_D4_RETAIL_INDUSTRY_DATA" FROM 16.07.33 AE VODS_ODS_PAYMENTECH T1 WHERE 16.07.33 AE (T1."ODS_PAYMENTECH_D1_RECORD_TYPE" <> '3'); …

Page 36: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios… to check data that is returned from database

13.54.03 BX Value: 1 13.54.03 BW <<< OLEFOC SQLDA Block 13.54.03 BW <<< OLEFOC SQLDA: Contains 6 elements, 6 select list expressions 13.54.03 BW <<< OLEFOC SQLDA: Name= E01, Addr= 00000000006364F0 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C136: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C138: BUS_SEGMENT 13.54.03 BW <<< OLEFOC SQLDA: Name= E02, Addr= 0000000000636568 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C17E: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C180: Business Segment 13.54.03 BW <<< OLEFOC SQLDA: Name= E03, Addr= 00000000006365E0 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C1C6: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C1C8: Business_Segment_Cd 13.54.03 BW <<< OLEFOC SQLDA: Name= E04, Addr= 0000000000636658 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C20E: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C210: Business_Segment_Desc

13.54.03 BX Value: 1 13.54.03 BW <<< OLEFOC SQLDA Block 13.54.03 BW <<< OLEFOC SQLDA: Contains 6 elements, 6 select list expressions 13.54.03 BW <<< OLEFOC SQLDA: Name= E01, Addr= 00000000006364F0 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C136: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C138: BUS_SEGMENT 13.54.03 BW <<< OLEFOC SQLDA: Name= E02, Addr= 0000000000636568 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C17E: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C180: Business Segment 13.54.03 BW <<< OLEFOC SQLDA: Name= E03, Addr= 00000000006365E0 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C1C6: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C1C8: Business_Segment_Cd 13.54.03 BW <<< OLEFOC SQLDA: Name= E04, Addr= 0000000000636658 13.54.03 BW <<< OLEFOC SQLDA: Type= Char(01C5), Length= 0040 13.54.03 BW <<< OLEFOC SQLDA: Indicator= Addr: 000000000240C20E: 0000 13.54.03 BW <<< OLEFOC SQLDA: Data= Addr: 000000000240C210: Business_Segment_Desc

Page 37: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios… to ensure that SQL request completed returning data

15.44.03 EW Command: Finish on segment 0 15.44.03 BU DQ: --- DQFIN , engine = SQLORA , session count = 0 15.44.03 BW >>> OR8FOC entered. (SQLORA), Gfun= 3, fun= 6; FOCUS_CLOSE. 15.44.03 BX **** or8foc: gfun: 3, fun: 6, cnum: 0 15.44.03 BX **** OCIHandleFree(errhp) call 15.44.03 BX **** OCIHandleFree return 15.44.03 BX **** status=0, "OCI_SUCCESS" 15.44.03 BX **** OCIHandleFree(envhp) call 15.44.03 BX **** OCIHandleFree return 15.44.03 BX **** status=0, "OCI_SUCCESS" 15.44.03 AR vxndel: delete request for module: ORAPAS2 --- dummy 15.44.03 BW <<< OR8FOC exited. (SQLORA), Errcode= 0; FOCUS_CLOSE.

15.44.03 EW Command: Finish on segment 0 15.44.03 BU DQ: --- DQFIN , engine = SQLORA , session count = 0 15.44.03 BW >>> OR8FOC entered. (SQLORA), Gfun= 3, fun= 6; FOCUS_CLOSE. 15.44.03 BX **** or8foc: gfun: 3, fun: 6, cnum: 0 15.44.03 BX **** OCIHandleFree(errhp) call 15.44.03 BX **** OCIHandleFree return 15.44.03 BX **** status=0, "OCI_SUCCESS" 15.44.03 BX **** OCIHandleFree(envhp) call 15.44.03 BX **** OCIHandleFree return 15.44.03 BX **** status=0, "OCI_SUCCESS" 15.44.03 AR vxndel: delete request for module: ORAPAS2 --- dummy 15.44.03 BW <<< OR8FOC exited. (SQLORA), Errcode= 0; FOCUS_CLOSE.

Page 38: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesTypical scenarios

4. Typical scenarios Savediags include the following traces--

Server log ($EDACONF/edaprint.log) Traces and other contents from the $EDACONF/edatemp/... directory, including the following: edachkup.trc Daemon check up facility trace edapdfm.trc Deferred Listener traceedaplog.trc EDAPRINT log daemon trace fds.trc FDS trace jscom*.trc Java traces edapth.trc Main workspace manager trace edaphtp.trc HTTP communication traces (listener) ht000nnn.trc HTTP communication traces (threads) edaptcp.trc TCP/IP communication traces (listener) ip000nnn.trc TCP/IP communication traces (threads) lu000nnn.trc SNA communication traces ts000nnn.trc Agent traces Server configuration ($EDACONF/bin/edaserve.cfg) Profiles from $EDACONF/etc/edasprof.prf and ibi/profiles/*

Server log ($EDACONF/edaprint.log) Traces and other contents from the $EDACONF/edatemp/... directory, including the following: edachkup.trc Daemon check up facility trace edapdfm.trc Deferred Listener traceedaplog.trc EDAPRINT log daemon trace fds.trc FDS trace jscom*.trc Java traces edapth.trc Main workspace manager trace edaphtp.trc HTTP communication traces (listener) ht000nnn.trc HTTP communication traces (threads) edaptcp.trc TCP/IP communication traces (listener) ip000nnn.trc TCP/IP communication traces (threads) lu000nnn.trc SNA communication traces ts000nnn.trc Agent traces Server configuration ($EDACONF/bin/edaserve.cfg) Profiles from $EDACONF/etc/edasprof.prf and ibi/profiles/*

Page 39: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

Working with TracesAdditional uses

4. Additional uses Performance issues

Look for search issues with multiple folders in pathCheck optimization Check timing of accessLook for non-essential parsing

OptimizationWHERE AggregationJOIN

Page 40: Working with Traces… Walter F. Blood Technical Director, FOCUS Division June, 2009

FOCUS Debugging Techniques Performance