Presentation is loading. Please wait.

Presentation is loading. Please wait.

Walter F. Blood Technical Director, FOCUS Division June, 2008

Similar presentations


Presentation on theme: "Walter F. Blood Technical Director, FOCUS Division June, 2008"— Presentation transcript:

1 Walter F. Blood Technical Director, FOCUS Division June, 2008
Debugging Techniques Walter F. Blood Technical Director, FOCUS Division June, 2008

2 FOCUS Debugging Techniques Agenda
When and Why? Debugging Itself The 5 Key Questions – General Techniques Reporting Issues - TABLE Integrity Code Performance

3 FOCUS Debugging Techniques Debugging Itself
When will you need debugging? You don’t get the results you expect Your old report stops working in a new release You get a FOCUS error message – FOCnnn Your report never comes back. Your systems person calls you to complain about your activity. FOCUS abends or you get a -12 from the server.

4 FOCUS Debugging Techniques Debugging Itself
What can you expect from debugging? To get the report working now To find a workaround for the problem if necessary To have the problem fixed by IBI if required

5 FOCUS Debugging Techniques General Techniques
The Five Key Questions Is the machine plugged in? What is the first sign of trouble? Can I make the problem occur with less code? What is FOCUS actually doing? What can FOCUS tell me?

6 FOCUS Debugging Techniques General Techniques
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

7 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Check description to determine nature of problem TABLE FILE CAR PRINT COUNTRY CAR MODEL AND COMPUTE SALES='$ ' | EDIT(SALES,'999$'); END > ERROR AT OR NEAR LINE 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 CAR PRINT COUNTRY CAR MODEL AND COMPUTE SALES='$ ' | EDIT(SALES,'999$'); END

8 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages SET ECHO ON; DEFINE FILE CAR CONTINENT/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; END TABLE FILE CAR SUM RETAIL_COST DEALER_COST PROFIT BY CONTINENT BY COUNTRY ON TABLE HOLD AS HOLDCAR FORMAT FOCUS INDEX COUNTRY -RUN TABLE FILE ABCHOLD PRINT SALES PROFIT BY CONTINENT

9 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages FOCUS errors compound Solve the earliest exposed problem first! > (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: ECHO ON; ERROR AT OR NEAR LINE IN PROCEDURE DBG2 FOCEXEC (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: FRANCE ERROR AT OR NEAR LINE IN PROCEDURE DBG2 FOCEXEC (FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE: D12.2CML% ERROR AT OR NEAR LINE IN PROCEDURE DBG2 FOCEXEC (FOC003) THE FIELDNAME IS NOT RECOGNIZED: PROFIT BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT ERROR AT OR NEAR LINE IN PROCEDURE DBG2 FOCEXEC (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: ABCHOLD

10 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages Incorrect or unexpected results Work backwards from incorrect results Look for Logic errors Incorrect assumptions FOCUS errors

11 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages Incorrect or unexpected results DEFINE FILE CAR PROFITMARGIN/D7=((RETAIL_COST - DEALER_COST)/DEALER_COST)*100; END TABLE FILE CAR SUM RETAIL_COST DEALER_COST PROFITMARGIN BY COUNTRY PAGE 1 COUNTRY RETAIL_COST DEALER_COST PROFITMARGIN ENGLAND , , FRANCE , , ITALY , , JAPAN , , W GERMANY , ,

12 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages Incorrect or unexpected results TABLE FILE CAR SUM RETAIL_COST DEALER_COST PROFITMARGIN COMPUTE PM/D7= ((RETAIL_COST - DEALER_COST)/DEALER_COST)*100; BY COUNTRY END PAGE 1 COUNTRY RETAIL_COST DEALER_COST PM ENGLAND , , FRANCE , , ITALY , , JAPAN , , W GERMANY , ,

13 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Multiple FOCUS error messages Incorrect results Abend Traces help identify FOCUS errors Dumps may be required

14 FOCUS Debugging Techniques General Techniques
2. What is the first sign of trouble? FOCUS error message Check description to determine nature of problem Multiple FOCUS error messages FOCUS errors compound Solve the earliest exposed problem first! Incorrect results Work backwards from incorrect results Look for FOCUS errors Abend Traces help identify FOCUS errors Dumps may be required

15 FOCUS Debugging Techniques General Techniques
3. Will the problem occur with less code? Simplify the problem. Remove code not related to the problem Segment code to facilitate testing Problem: User had a problem with a line FOCEXEC. Solution: Use -GOTO in Dialogue Manager, and GOTO in MODIFY, to skip blocks of code. Checkpoint and rerun from last successful step.

16 FOCUS Debugging Techniques General Techniques
Remove code until problem disappears TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 SUBTOTAL PLUS-OTHERS WHERE ((W1 GE W2 AND W1 LE W3) AND (W4 LT W5 OR W6 LT W7)) OR (W5*24 GE W9 +W1); ON S1 SUBHEAD “ “ TOTALS FOR <S1 ON TABLE HOLD AS ABCOUT FORMAT PDF ON TABLE SET STYLE * TYPE = REPORT, … ENDSTYLE END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 ON TABLE HOLD AS ABCOUT FORMAT PDF END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 SUBTOTAL PLUS-OTHERS WHERE ((W1 GE W2 AND W1 LE W3) AND (W4 LT W5 OR W6 LT W7)) OR (W5*24 GE W9 +W1); ON S1 SUBHEAD “ “ TOTALS FOR <S1 ON TABLE HOLD AS ABCOUT FORMAT PDF END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 SUBTOTAL PLUS-OTHERS WHERE ((W1 GE W2 AND W1 LE W3) AND (W4 LT W5 OR W6 LT W7)) OR (W5*24 GE W9 +W1); ON TABLE HOLD AS ABCOUT FORMAT PDF END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 WHERE ((W1 GE W2 AND W1 LE W3) AND (W4 LT W5 OR W6 LT W7)) OR (W5*24 GE W9 +W1); ON TABLE HOLD AS ABCOUT FORMAT PDF END TABLE FILE ABC SUM F1 F2 F3/A4 FST.F4 BY S1 NOPRINT BY S2 BY HIGHEST 3 S3 SUBTOTAL PLUS-OTHERS WHERE ((W1 GE W2 AND W1 LE W3) AND (W4 LT W5 OR W6 LT W7)) OR (W5*24 GE W9 +W1); ON S1 SUBHEAD “ “ TOTALS FOR <S1 ON TABLE HOLD AS ABCOUT FORMAT PDF ON TABLE SET STYLE * TYPE = REPORT, … ENDSTYLE END

17 FOCUS Debugging Techniques General Techniques
Segment TABLE request to isolate the problem -DEFAULTS START=STEP1, STOP=STEP99,ECHO=OFF -SET ECHO=&ECHO; -GOTO &START -STEP1 TABLE FILE … lots of code -GOTO NOSTY ON TABLE SET STYLE * TYPE = REPORT, … ENDSTYLE -NOSTY END

18 FOCUS Debugging Techniques General Techniques
Use GOTO to exclude MODIFY cases MODIFY FILE … GOTO TWO CASE ONE ENDCASE CASE TWO ON MATCH/NOMATCH GOTO END CASE THREE DATA END

19 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is happening. In TABLE: Use LET NOPRINT = ; to show complete request Use SET DEFECHO to show variable substitution Use –TYPE to expose system variable values SET DEFECHO=ALL TABLE FILE CAR SUM … WHERE COUNTRY EQ &VAR1 LET NOPRINT = ; TABLE FILE CAR SUM RETAIL_COST BY COUNTRY NOPRINT TABLE FILE CAR END -RUN -TYPE RECORDS &RECORDS

20 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is happening. In MODIFY: Use MODIFY FILE xxx TRACE to locate CASE Use TYPE IN CASE xxx to indicate position inside case **** START OF TRACE **** TRACE ===> AT CASE TOP DATA FOR TRANSACTION 1 EMP_ID => CURR_SAL => 67000 TRACE ===> AT CASE HIGHSAL YOU ENTERED A SALARY ABOVE $50000 MODIFY FILE EMPLOYEE CASE ONE TYPE IN CASE ONE MATCH EMP_ID TYPE AFTER MATCH ON MATCH UPDATE CURR_SAL

21 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is 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 SET DEFECHO=ALL -SET &ECHO=ON EX pgm2 ECHO=&ECHO -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

22 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is happening. In SQL Translator: Use ECHO to show the generate FOCUS code Use FILE nnn to create focexec with FOCUS code SQL SELECT BODYTYPE, AVG(MPG), SUM(SALES) FROM CAR WHERE RETAIL_COST > 5000 GROUP BY BODYTYPE; ECHO TABLE END > SET COUNTWIDTH=ON -SET SQLERRNUM = 0; TABLE FILE CAR WRITE MIN.BODYTYPE AS 'BODYTYPE' AVE.MPG SUM.SALES BY BODYTYPE NOPRINT WHERE ( RETAIL_COST GT 5000 ) ; ON TABLE SET CARTESIAN ON ON TABLE SET ASNAMES ON ON TABLE SET HOLDLIST PRINTONLY END -RUN

23 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is happening. With Interfaces: Use SET XRETRIEVAL=OFF to suppress data access SET XRETRIEVAL=OFF TABLE FILE DB2FILE SUM RETAIL_COST DEALER COST BY COUNTRY WHERE SALES GT 5000 END ...RETRIEVAL KILLED NUMBER OF RECORDS IN TABLE= LINES=

24 FOCUS Debugging Techniques General Techniques
4. What is FOCUS/WebFOCUS actually doing? Expose what is happening. With Interfaces: Use SET XRETRIEVAL=OFF to suppress data access Use Traces to expose interface activity SET TRACEUSER=ON SET TRACEOFF=ALL SET TRACEON=STMTRACE/CLIENT SET TRACEON=STMTRACE/FSTRACE SQLDI - Records SQL, RDBMS return codes, cursor operations  SQLAGGR - Displays data adapter-to-RDBMS aggregation & join analysis STMTRACE - SQL generated by the data adapter, Direct SQL Passthru

25 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use CHECK FILE to determine PATHs if you get -- FOC144 – Testing on independent paths of data FOC All verb objects must be in the same path as their sort fields CHECK FILE EMPLOYEE PICTURE S1 ************** *EMP_ID ** *LAST_NAME ** *FIRST_NAME ** *HIRE_DATE ** * ** *************** I I I I I I I FUNDTRAN I PAYINFO I ADDRESS I SALINFO I ATTNDSEG 02 I U I SH I S I SH I KM ************** ************** ************** ************** *BANK_NAME * *DAT_INC ** *TYPE ** *PAY_DATE ** :DATE_ATTEND :: *BANK_CODE * *PCT_INC ** *ADDRESS_LN1 ** *GROSS ** :EMP_ID ::K *BANK_ACCT * *SALARY ** *ADDRESS_LN2 ** * ** : :: *EFFECT_DATE * *JOBCODE ** *ADDRESS_LN3 ** * ** : :: * * * ** * ** * ** : :: ************** *************** *************** *************** : :: ************** ************** ************** :

26 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use CHECK FILE HOLD to determine PATHs if you get -- CHECK FILE EMPLOYEE HOLD FILE=FOCMAST,SUFFIX=FIX,$ SEGMENT=FILEATTR,$ FIELD=RECTYPE,FLE,A4,A4,$ FIELD=FILENAME,FILN64,A64,A64,$ FIELD=SUFFIX,FILN34,A8,A8,$ …. SEGMENT=SEGATTR,PARENT=FILEATTR,$ FIELD=RECTYPE,SEG,A4,A4,$ FIELD=SEGNO,SEGNUM,I2S,I4,$ FIELD=LEVEL,LLEVEL1,I2S,I2,$ …. SEGMENT=FLDATTR,PARENT=SEGATTR,$ FIELD=RECTYPE,FLD,A4,A4,$ FIELD=FLDNO,FLDNUM,I4S,I4,$ FIELD=FIELDNAME,FIELD,A66 ,A66 ,$ TABLE FILE HOLD PRINT SEGNAME SEGNO FIELDNAME/A30 PATH WHERE FIELDNAME EQ ….. END

27 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? FILEDEF - Check for expected file allocations ? TSO DDNAME – Check the file characteristics ? TSO DDNAME MULTVOL DDNAME = MULTVOL DSNAME = USER1.FOCTST.MULTVOL DISP = NEW DEVICE = DISK VOLSER = MFOC02,MFOC01 DSORG = PS RECFM = F SECONDARY = 4 ALLOCATION = TRACKS BLKSIZE = 4096 LRECL = 4096 TRKTOT = 92 EXTENTSUSED = 23 BLKSPERTRK = 12 TRKSPERCYL = 15 CYLSPERDISK = 2227 BLKSWRITTEN = 1104 FOCUSPAGES = 1059

28 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? LET – Find active alternative command meanings Identify deactivated commands Identify abbreviated commands Validate your commands ? LET OTH ON TABLE HOLD AS PR PRINT S SUM TF TABLE FILE SCAN END >

29 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? DEFINE [filename] Show virtual fields available – focexec/master Identify unexpected duplicates Validate type, length and source ? DEFINE FILE FIELD NAME FORMAT SEGMENT VIEW TYPE EMPLOYEE FCONCAT A MASTER EMPLOYEE FARITH I9S MASTER EMPLOYEE FIFTHEN I MASTER CAR PROFIT D CAR MARGIN D CAR CONTINENT A EMPLOYEE WKSAL D

30 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? USE – Display file usage including SU/FDS usage Check file concatenation Verify read/write status ? USE DIRECTORIES IN USE ARE: CAR FOCUS A CAR1 FOCUS A AS CAR CAR2 FOCUS A AS CAR EMPLOYEE FOCUS A ON SINK1 JOBFILE FOCUS A READ >

31 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? SET - Display most common parameters and values ? SET ALL - Display all parameters and values ? SET <parameter> - Display single parameter and value ? SET FOR <parameter> – Display allowed set contexts Display FOCUS settings in effect Check for expected settings at time of error Check when using ON TABLE SET PROFILEs change them, cumulative effect

32 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? ? SET PARAMETER SETTINGS ALL OFF FOCALLOC OFF PRINTPLUS OFF ASNAMES FOCUS FOCCREATELOC OFF QUALCHAR AUTOINDEX ON FOCSTACK SIZE QUALTITLES OFF AUTOPATH ON FOCTRANSFORM OFF REBUILDMSG BINS FOC2GIGDB OFF RECAP-COUNT OFF BLKCALC NEW HDAY SAVEMATRIX OFF BUSDAYS _MTWTF_ HIPERFOCUS OFF SCREEN ON BYPANELING OFF HOLDATTRS FOCUS SHADOW PAGE OFF CACHE HOLDLIST ALL SMARTMODE OFF CARTESIAN OFF HOLDSTAT OFF SPACES AUTO CDN OFF HOTMENU OFF SQLENGINE COLUMNSCROLL OFF IBMLE ON SUMPREFIX LST DATEDISPLAY OFF INDEX TYPE NEW TCPIPINT OFF DATEFNS ON LANGUAGE AMENGLISH TEMP DISK Z DATETIME STARTUP/RESET LINES/PAGE TERMINAL IBM3270 DEFCENT LINES/PRINT TESTDATE TODAY DEFECHO OFF MESSAGE ON TITLES ON EMPTYREPORT OFF MODE CMS VIEWNAMESIZE EXCELRELEASE MULTIPATH SIMPLE WIDTH EXL2KLANG NODATA WINPFKEY OLD MORE... IBIVM ? SET <parameter ? SET HOLDLIST HOLDLIST ALL > ? SET FOR <parameter ? SET FOR PRINTPLUS PRINTPLUS OFF SETTABLE FROM COMMAND LINE : YES SETTABLE ON TABLE : NO SETTABLE FROM SYSTEM-WIDE PROFILE : YES SETTABLE FROM HLI PROFILE : YES POOL TABLE BOUNDARY : NO

33 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? && - Global variables in effect and their values Check that the values are expected Unexpected values can point to other focexecs &Vars can be seen with -? &var Insert into focexec followed by -RUN ? && &&ECHO OFF &&MAXIMUM &&MINIMUN &&ONE FIRST >

34 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? JOIN - List JOINs in effect Verify the path generated by multiple JOINs Check JOIN details ? JOIN JOINS CURRENTLY ACTIVE HOST CROSSREFERENCE FIELD FILE TAG FIELD FILE TAG AS ALL WH COUNTRY CAR COUNTRY CONTNENT J N N JOBCODE EMPLOYEE JOBCODE JOBFILE J N N ID_NUM SALES EMP_ID EDUCFILE J Y N BODYTYPE CAR EMP_ID EMPLOYEE J Y Y >

35 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? FILTER – Show filters in effect Display active hidden screening conditions Validate total screening being done If filtering used as DBA, check user access ? FILTER SET FILE FILTER NAME DESCRIPTION CAR HIMARGIN CAR MDMARGIN * CAR LOMARGIN

36 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? COMBINE – Display files grouped together for MODIFY ? LOAD – Display focexecs compiled and loaded into memory Validate that compiled environment is the same as the run environment Check JOINs, ALLOCs and FILEDEFs ? COMBINE FILE=ALLONE TAG PREFIX CAR EMPLOYEE JOBFILE EDUCFILE

37 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? STYLE – Style settings currently in effect ? STYLE ONLINE-FMT OFFLINE-FMT STANDARD STYLESHEET ON SQUEEZE OFF PAGESIZE Letter ORIENTATION PORTRAIT UNITS INCHES LABELPROMPT OFF LEFTMARGIN RIGHTMARGIN TOPMARGIN BOTTOMMARGIN STYLEMODE FULL TARGETFRAME FOCEXURL BASEURL

38 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? FILE <focusfile> - Current state of the FOCUS file STATUS OF FOCUS FILE: CAR FOCUS A ON 04/24/2008 AT ACTIVE DELETED DATE OF TIME OF LAST TRANS SEGNAME COUNT COUNT LAST CHG LAST CHG NUMBER ORIGIN /10/ COMP /10/ CARREC /10/ BODY /10/ SPECS /10/ WARANT /10/ EQUIP /10/ *INDEXES* COUNTRY /10/ TOTAL SEGS TOTAL CHAR TOTAL PAGES LAST CHANGE /10/

39 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? FDT <focusfile> - Displays file directory table of FOCUS file Check segment details DIRECTORY:CAR FOCUS A ON 04/24/2008 AT DATE/TIME OF LAST CHANGE: 04/10/ SEGNAME LENGTH PARENT START END PAGES LINKS TYPE 1 ORIGIN 2 COMP 3 CARREC 4 BODY 5 SPECS 6 WARANT 7 EQUIP COUNTRY NEW

40 FOCUS Debugging Techniques General Techniques
5. What can FOCUS tell me? Use FOCUS Query Facilities to find hidden conditions ? STAT – Statistics for previous request/transaction STATISTICS OF LAST COMMAND RECORDS = SEGS DELTD = LINES = NOMATCH = BASEIO = DUPLICATES = SORTIO = FORMAT ERRORS = SORT PAGES = INVALID CONDTS = READS = OTHER REJECTS = TRANSACTIONS = CACHE READS = ACCEPTED = MERGES = SEGS INPUT = SORT STRINGS = SEGS CHNGD = INDEXIO = INTERNAL MATRIX CREATED: YES AUTOINDEX USED: NO SORT USED: FOCUS AUTOPATH USED: YES AGGREGATION BY EXT.SORT: NO HOLD FROM EXTERNAL SORT: NO

41 FOCUS Debugging Techniques General Techniques
KNOW the product! Refer to the doc when in doubt Search techsupport.informationbuilders.com Ask questions on Focalpoint Problem: User was getting strange results from a User Written Subroutine. Solution: Check the documentation. User had incorrect arguments.

42 FOCUS Debugging Techniques General Techniques
Assume nothing! CHECK EVERYTHING! Problem: User was trying to do a segment redefinition, using POSITION. Solution: Fields Were Incorrectly Added FIELD=POSN1,E15,A50,A50,$ SEGNAME=SEG1,POSITION=POSN1,OCCURS=5 FIELD=FLD1, , A200, A200,$ OCCURS = 5, LENGTH of the segment was 1000

43 FOCUS Debugging Techniques General Techniques
Do NOT use defaults! Code what you want to happen. D EFAULT ISASTER both begin with “D”. TABLE Put fields referenced in COMPUTEs as verb objects (NOPRINTed). MODIFY Code “ON NOMATCH” condition before “ON MATCH” after EVERY MATCH.

44 FOCUS Debugging Techniques General Techniques
If all else fails, GUESS at the solution, and TEST to verify Problem: Columns in EMR were incorrect or missing. Solution: Eliminated column specifications. Found that FOCUS was adding verb objects for fields referenced in COMPUTEs.

45 FOCUS Debugging Techniques General Techniques
When problems occur (and they will), eliminate, simplify, and reproduce on standard file (CAR, EMPLOYEE, GGDEMO). Many times, what occurs is a symptom, not a cause. When debugging, COPY the file and start removing a little at a time, until it works. Then see what is affected by the addition of the last removed item. Alternatively, Use –GOTO to eliminate lines, and add back in until it doesn’t work.

46 FOCUS Debugging Techniques Integrity
Testing database validity FOCUS Files Compare ? FDT vs Master File Description Check Physical vs. logical TableF Run VALIDATE FOCEXEC Sequential Files Compare CHECK FILE (minus GROUPs, POSITION segments) vs LRECL VSAM Files Compare IDCAMS vs Master File Description

47 FOCUS Debugging Techniques Testing Database Validity
Run VALIDATE On the FOCUS CAR file *************** *LOGICAL COUNT* *************** STATUS OF FOCUS FILE CAR COUNT OF FIELD OCCURENCES THROUGH A ‘TABLEF’ COMMAND ON 02/08/95 AT ORIGIN COUNT COMP COUNT CARREC COUNT BODY COUNT SPECS COUNT* WARANT COUNT EQUIP COUNT TOTAL NOTE: SEGMENT COUNTS FOLLOWED BY ‘*’ ARE FOR UNIQUE SEGMENTS THESE COUNTS MAY NOT AGREE WITH THE PHYSICAL COUNT FOR THAT SEGMENT. THIS CAN OCCUR WHEN DEFAULT VALUES ARE SUPPLIED FOR NON-EXISTENT UNIQUE SEGMENTS.

48 FOCUS Debugging Techniques Testing Database Validity
Compare to ? FILE On the FOCUS CAR file STATUS OF FOCUS FILE: CAR FOCUS A1 ON 02/08/95 AT 19:39: ACTIVE DELETED DATE OF TIME OF LAST TRANS SEGNAME COUNT COUNT LAST CHG LAST CHG NUMBER ORIGIN /16/ :18: COMP /16/ :18: CARREC /16/ :18: BODY /16/ :19: SPECS /16/ :18: WARANT /16/ EQUIP /16/ ***INDEXES*** COUNTRY /16/ :18: TOTAL SEGS TOTAL CHARS TOTAL PAGES LAST CHANGE /16/ :19:05

49 FOCUS Debugging Techniques Code - Creating Test Data
Some problems require lots of data to reproduce Specific data not important Problem is volume-related No one wants to create data Let FOCUS do it COMPUTE a counter Use EDIT to make alpha fields

50 FOCUS Debugging Techniques Code - Creating Test Data
DEFINE FILE realfile CTR/I9 WITH CUSIP = CTR + 1; CUSIP/A9 WITH CUSIP = CTR; AMOUNT/D12.2M WITH AMOUNT = CTR ; END TABLE FILE realfile PRINT CUSIP AMOUNT … ON TABLE HOLD AS name FORMAT format

51 FOCUS Debugging Techniques Code - Creating Test Data
MODIFY FILE xxx COMPUTE TEST/A1=; FIXFORM TEST/1 REPEAT &number NOHOLD COMPUTE CTR/I5=CTR+1; other fields MATCH ... ENDREPEAT DATA X END

52 FOCUS Debugging Techniques Performance
Are you using the latest FOCUS efficiencies? BY TOTAL Multi-Path Compiled DEFINES SET SAVEDMASTERS FOCUS 7.6 SET MODCOMPUTE=NATV SET DIRECTHOLD=ON

53 FOCUS Debugging Techniques Performance
FOCUS limits are being raised FOC ERROR WRITING FOCSORT Unlimited FOCSORT (FOCUS 7.6) 2G FOCUS File Limit SET FOCUS2GDB=ON (FOCUS for S390) XFOCUS database with 16GB partition MDI for FOCUS and XFOCUS (FOCUS 7.6)

54 FOCUS Debugging Techniques Performance
Questions to ask when analyzing performance Should I use DEFINES ? Will COMPUTEs work the same way Why isn’t Screening returning correct results ? SET MULTIPATH ? SET ALL Do I need 2-pass processing Note time for each step.

55 FOCUS Debugging Techniques Performance
Questions?


Download ppt "Walter F. Blood Technical Director, FOCUS Division June, 2008"

Similar presentations


Ads by Google