IBI WebFOCUS - Testing and Debugging in WebFOCUS codes

You can debug a Web FOCUS application by querying your environment to display information such as file status, release, server information, and joins, as well as by identifying files you are using.
Other debugging methods are available in Web FOCUS, including specialized Dialogue Manager Variables and traces performed from the Web Console.

Debugging Your Application with Query Commands
You can use query commands to display information about your metadata, data sources, language environment, Developer Studio, and Web FOCUS. This is useful for determining any aspects of your application that may be preventing the proper behavior of your application. You can query your environment with a query command executed in Developer Studio or Web FOCUS.
The result of a query command is returned in your browser window or as a comment in the HTML file. Use the applicable Web browser functions to view the HTML comments (for example, View Source in Microsoft Internet Explorer).


How to Issue a Query Command
Syntax: The syntax of query command is given as:
? Query [Filename]
Where:
Query --> is the subject of the query command.
Filename --> is the name of the file that is the subject of the query. This parameter applies to only some queries.

To list the query commands, type a question mark in a procedure.
The following is a list of query commands.

Query Command
Description
? COMBINE
Displays a list of combined file structures.
? DEFINE
Displays currently active virtual fields created by the DEFINE command or attribute.
? SET EUROFILE
Lists fields currently available to you.
?F
Lists fields currently available.
? FDT
Displays physical attributes of a FOCUS data source.
?FF
Lists field names, aliases, and format information for an active Master File.
? FILE
Displays the number of segment instances in a FOCUS data source and the last time the data sources was changed.
? FILEDEF
Displays the current ddnames assigned by the FILEDEF command.
? FUNCTION
Displays functions created with the DEFINE command.
? HOLD
Displays fields described in a HOLD Master File.
? JOIN
Displays JOIN structures that exist between data sources.
? LANG
Displays information about National Language Support.
? MDI
Generates statistics and descriptions for multi-dimensional indexes.
? n
Displays an explanation of an error message (n represents the number of the error message).
? PATH
Displays the current search path.
? RELEASE
Displays the release number of your product.
? REMOTE
Displays the values of the remote servers.
? SET
Displays parameter settings that control Developer Studio and WebFOCUS.
? SET BY 
CATEGORY
Displays parameter settings categorized into functional areas.
? SET GRAPH
Displays parameter settings that control graphs produced with the GRAPH command.
? SET NOT
Produces a list of SET commands that cannot be set in a specific area.
? SITECODE
Retrieves the site code of the connected server.
? STAT
Displays statistics about the last command executed.
? STYLE
Displays the current settings for Style Sheet parameters.
? SU
Is communication available to the SU machine.
? USE
Displays data sources specified with the USE command.
? &&
Displays values of global variables.





Displaying Combined Structures:  The “? COMBINE” command displays files that are in the current combined structures.

Syntax:
? COMBINE [Filename]
Where:
Filename is the data source containing the virtual fields. If filename is omitted, the command displays all virtual fields.
Example:
Issuing the command
? COMBINE
Produces information similar to the following:
FILE=EMPLJOB COMBINED FROM
   EMPLOYEE
   JOBFILE
 
Displaying Virtual Fields: The? DEFINE command lists the active virtual fields used in a request. The fields can be created by either the DEFINE command or DEFINE attribute in the Master File. The command displays field names of up to 32 characters. If a name exceeds 32 characters, a symbol in the 32nd position indicates a longer field name. In WebFOCUS this symbol is an ampersand (&), and in Developer Studio this symbol is a caret (>).

Syntax:
? DEFINE [Filename]
Where:
Filename is the data source containing the virtual fields. If filename is omitted, the command displays all virtual fields.
Example:
Assume that you created a virtual field named NEW_DATE in a request against the EMPLOYEE database.
Issuing the command
? DEFINE
Produces the following information:
FILE        FIELD NAME                FORMAT    SEGMENT    VIEW    TYPE
EMPLOYEE    NEW_DATE                  YYMD            2
The following information is listed for each virtual field created with DEFINE:
Option
Description
FILE
Is the name of the data source containing the virtual field.
FIELD NAME
Is the name of the virtual field.
FORMAT
Is the format of the virtual field. The notation is the same as that used for the FORMAT attribute in a Master File.
SEGMENT
Is the number of the segment in the Master File containing the virtual field. During reporting, your application treats the virtual field as a field in this segment. To relate segment numbers to segment names, use ? FDT.
VIEW
Is the root segment of DEFINE that specifies an alternate view. For example:
DEFINE FILE EMPLOYEE.JOBCODE
TYPE
Indicates whether the virtual field is created by the DEFINE attribute in the Master File, or by a DEFINE command, identified by MASTER or a blank, respectively.
 
 

Displaying Available Fields: The? F command displays the fields that are currently available. ? F displays entire 66 character field names.

Syntax:
? F Filename
Where:
Filename is the name of a data source.
Example:
Issuing the command
? F EMPLOYEE
Produces the following information:
FILENAME = EMPLOYEE 
 
EMP_INFO.EMP_ID         LAST_NAME      FIRST_NAME     HIRE_DATE
DEPARTMENT   CURR_SAL    CURR_JOBCODE   ED_HRS 
BANK_NAME   BANK_CODE   BANK_ACCT      EFFECT_DATE
DAT_INC     PCT_INC     SALARY         PAYINFO.JOBCODE 
TYPE        ADDRESS_LN1 ADDRESS_LN2    ADDRESS_LN3    ACCTNUMBER 
PAY_DATE    GROSS 
DED_CODE    DED_AMT 
JOBSEG.JOBCODE          JOB_DESC 
SEC_CLEAR 
SKILLS      SKILLS_DESC 
DATE_ATTEND ATTENDSEG.EMP_ID 
COURSE_CODE COURSE_NAME



Displaying Field Information for a Master File: The? FF command displays field names, aliases, and format information for an active Master File.

Syntax:
?FF Filename [String]
Where:
Filename
Is the name of the Master File.
String
Is a character string up to 66 characters long. The command displays information only for fields beginning with the specified character string. If you omit this parameter, the command displays information for all fields in the Master File.

Example:

Issuing the command
? FF EMPLOYEE
Produces the following information:
FILENAME= EMPLOYEE  
EMPINFO.EMP_INFO   EMPINFO.EID    A9
LAST_NAME          LN             A15
FIRST_NAME         FN             A10
HIRE_DATE          HDT            16YMD
DEPARTMENT         DPT            A10
CURR_SAL           CSAL           D12.2M
CURR_JOBCODE       CJC            A3
ED_HRS             OJT            F6.2 
BANK_NAME          BN             A20
BANK_CODE          BC             I6S
BANK_ACCT          BA             I9S
EFFECT_DATE        EDATE          16YMD
 
Displaying Data Source Statistics: The? FILE command displays information such as the number of segment instances in a FOCUS data source and when the data source was last changed.

Syntax:
? FILE Filename
Where:
Filename
Is the name of the data source.

Example:

Issuing the command
? FILE EMPLOYEE
Produces statistics similar to the following:
    STATUS OF FOCUS FILE: D:\ibi\apps\...\employee.foc ON 07/14/2000 AT 14.59.14
              ACTIVE  DELETED    DATE OF     TIME OF      LAST TRANS
SEGNAME       COUNT   COUNT      LAST CHG    LAST CHG       NUMBER 
EMPINFO           12             06/14/2000  11.04.01          
FUNDTRAN           6             03/31/2000  11.16.15          6
PAYINFO           19             06/05/2000  16.07.49         
ADDRESS           21             03/31/2000  11.16.15         21
SALINFO           70             03/31/2000  11.16.16        448
DEDUCT           448             03/31/2000  11.16.16        448
TOTAL SEGS       576
TOTAL CHARS     8984
TOTAL PAGES        8
LAST CHANGE                      06/14/2000  11.01.01 
The following data source statistics are listed:
SEGNAME
Is the name of each segment in the data source. After the segments, the indexes are listed, if applicable.
Indexes are those fields specified by the attribute FIELDTYPE=I in the Master File.
ACTIVE COUNT
Is the number of instances of each segment.
DELETED COUNT
Is the number of segment instances deleted, for which the space is not reused.
DATE OF LAST CHG
Is the date on which data in a segment instance or index was last changed.
TIME OF LAST CHG
Is the time of day, on a 24-hour clock, when the file's last update was made for that segment or index.
LAST TRANS 
NUMBER
Is the number of transactions performed by the last update request to access the segment. If the data source was changed under Simultaneous Usage mode, this column refers to the REF NUMB column of the CR HLIPRINT file.
TOTAL SEGS
Is the total number of segment instances in the file (shown under ACTIVE COUNT), and the number of segments deleted when the file was last changed (shown under DELETED COUNT).
TOTAL CHARS
Is the number of characters of data in the file.
TOTAL PAGES
Is the number of pages in the data source. Pages are physical records in FOCUS data sources.
LAST CHANGE
Is the date and time the data source was last changed.
If a data source is disorganized by more than 29%, that is, the physical placement of data in the data source is considerably different from its logical or apparent placement, the following message appears
FILE APPEARS TO NEED THE -REBUILD- UTILITY
REORG PERCENT IS A MEASURE OF FILE DISORGANIZATION
0 PCT IS PERFECT -- 100 PCT IS BAD
REORG PERCENT IS x%
Where:
x
Is a percentage between 30 and 100.
The variable &FOCDISORG also indicates the level of disorganization. Following is an example of how to use &FOCDISORG in a Dialogue Manager -TYPE command:
-TYPE THE AMOUNT OF DISORGANIZATION OF THIS FILE IS: &FOCDISORG
This command, depending on the amount of disorganization, produces a message similar to the following:
THE AMOUNT OF DISORGANIZATION OF THIS FILE IS: 10
When using a -TYPE command with &FOCDISORG, a message is displayed even if the percentage of disorganization is less than 30%.

Displaying Defined Functions: The ? FUNCTION command displays all defined functions and the parameters.
 
Syntax:
To display defined functions, issue the command:
? FUNCTION

Example:

Issuing the command
? FUNCTION
Produces information similar to the following:
FUNCTIONS CURRENTLY ACTIVE  
Name       Format    Parameter      Format   
SUBTRACT   D8.2      VAL1           D8
                     VAL2           D8




Displaying HOLD Fields: The ? HOLD command lists fields described in a Master File created by the ON TABLE HOLD command. The list displays the field names, the aliases, and the formats as defined by the FORMAT (USAGE) attribute. The ? HOLD command displays field names up to 32 characters. If a field name exceeds 32 characters, a symbol in the 32nd position indicates a longer field name. In WebFOCUS, this symbol is an ampersand, and in Developer Studio the symbol is a caret (>).
The ? HOLD command displays fields of a HOLD Master File created by the current request.


Syntax:
? HOLD [Filename]
Where:
Filename
Is the name assigned in the AS phrase in the ON TABLE HOLD command. If you omit the file name, it defaults to HOLD.

Example:

Issuing the command
? HOLD
Produces information similar to the following:
DEFINITION OF HOLD FILE
FIELDNAME                         ALIAS       FORMAT 
LAST_NAME                         E01         A15
FIRST_NAME                        E02         A10



Displaying JOIN Structures: The ? JOIN command lists the JOIN structures currently in effect. The command displays field names up to 12 characters. If a field name exceeds 12 characters, a symbol in the twelfth position indicates a longer field name. In WebFOCUS this symbol is an ampersand (&), and in Developer Studio the symbol is a caret (>).

Syntax:
To display JOIN structures, issue the command:
? JOIN
 

Example:
Issuing the command
? JOIN
Produces information similar to the following:
  JOINS CURRENTLY ACTIVE
 
HOST                        CROSSREFERENCE
FIELD      FILE      TAG    FIELD      FILE     TAG    AS       ALL  WH
-----      ----      ---    -----      ----     ---    --       ---  --
JOBCODE    EMPLOYEE         JOBCODE    JOBFILE         

The following JOIN information is listed:
HOST FIELD
Is the name of the host field that is joining the data sources.
FILE
Is the name of the host data source.
TAG
Is a tag name used as a unique qualifier for field names in the host data source.
CROSSREFERENCE 
FIELD
Is the name of the cross-referenced field used to join the data sources.
FILE
Is the name of the cross-referenced data source.
TAG
Is a tag name used as a unique qualifier for field names in the cross-referenced data source.
AS
Is the name of the joined structure.
ALL
Displays Y for a non-unique join and N for a unique join.
WH
Specifies whether the join is a conditional join or an equi-join.




Displaying National Language Support: The ? LANG command displays information about National Language Support.


Syntax:
To display information about National Language Support:
? LANG
 

Example:
Issuing the command
? LANG
Produces information similar to the following:
        NATIONAL LANGUAGE INFORMATION 
Language                001/AMENGLISH   (   )
Code Page               437
client Code Page        437
Dollar                  24($)
Lowcase alphabet        YES
Decimal notation        OFF(.)
Currency symbol         $
Date/Time format        EDA
NLS sort                NO
NLS upcase/lowcase      NO
DBCS Flag               OFF(SBCS)



Displaying Explanations of Error Messages: The ? n command displays a detailed explanation of an error message, providing assistance in correcting the error.
Error messages generated by certain data adapters, such as the DB2 and MODEL 204 data adapters, are also accessible through this feature.

Syntax:
? N
Where:
--> Is the error message number.

Example:
If you receive the message
(FOC125) RECAP CALCULATIONS MISSING
Issuing the command
? 125
Produces the following message:
(FOC125) RECAP CALCULATIONS MISSING
The word RECAP is not followed by a calculation. Either the RECAP should be removed, or a calculation provided.



Displaying Parameter Settings: The ? SET command lists the parameter settings that control your Developer Studio and WebFOCUS environments. Your application sets default values for these parameters, but you can change them with the SET command.


Syntax:
? SET [ALL|[FOR] Parameter]
Where:
ALL
Displays all possible parameter settings.
Parameter -->Is a SET parameter. This displays the setting for the specific parameter.
FOR  àIncludes where the parameter can be set from in addition to the parameter setting.

Example:
Issuing the command
? SET ONLINE-FMT
Produces the following if the parameter is set to its default value:
ONLINE-FMT             HTML
 
 
Example:
Issuing the command
? SET FOR EXTSORT
Produces the following information:
EXTSORT                   ON
 
 ------------------------------------------------- 
 SETTABLE FROM COMMAND LINE                  :  YES
 SETTABLE ON TABLE                           :  YES
 SETTABLE FROM SYSTEM-WIDE PROFILE           :  YES
 SETTABLE FROM HLI PROFILE                   :  YES
 POOL TABLE BOUNDARY                         :  YES
 

Displaying Parameters That Cannot Be Set in an Area: The ? SET NOT command produces a list of SET commands that cannot be set in a specific area. The areas for which you can find this information are the PROMPT command, report requests, the FOCPARM profile, the HLI profile, and Pooled Tables.

Syntax:
? SET NOT Area
Where:
Area
Is one of the following:
PROMPT is the PROMPT command.
ONTABLE is a report request.
FOCPARM is the FOCPARM profile.
HLIPROF is the HLI profile.
PT is in Pooled Tables

Example:
Issuing the command
? SET NOT ONTABLE
Produces the following information:
              NON-SETTABLE ON TABLE PARAMETER SETTINGS
 
BINS           64     FOC2GIGDB            ON    PRINTPLUS            OFF
BLKCALC        NEW    FOCSTACK SIZE         8    RADIOBUTTON          OFF
BYPANELING     OFF    FORMFEED          ASCII    REBUILDMSG          1000
CACHE            0    HTMLMODE            OFF    SAVEMATRIX           OFF
CGI-RELEASE   5200    IFSORT               ON    SMARTMODE           ????
CODEBASE      ????    LANGUAGE      AMENGLISH    SORTNAME           XSBEG
COLUMNSCROLL  OFF     MAXPOOLMEM         32768   TALKCASE             OFF
DATEDISPLAY   OFF     MDIBINS             8000   TCPIPINT             OFF
DATEFNS        ON     MDIPROGRESS       100000   TEMP DISK D:\ibi\srv7...
DATEFORMAT    MDY     MODE                 CMS   TRMSD                  0
DEFCENT        19     MPRINT               NEW   TRMSW                  0
DEFINES       OLD     NLSCTRL              OFF   TRMTYP          64  64/S
DISTRIBUTE    OFF     POOL                 OFF   WEBHOME              OFF
DISTRICT       ON     POOLBATCH            OFF   WEEKFIRST              7
ERROROUT      OFF     POOLFEATURE          OFF   WIDTH                130
EUROFILE              POOLMEMORY         16384   WINPFKEY             OLD
FIELDNAME     NEW     POOLRESERVE         1024   YRTHRESH               0



Displaying Graph Parameters: The ? SET GRAPH command lists the parameter settings that control graphs produced with the GRAPH command.

Syntax:
To display graph parameters, issue the command:
? SET GRAPH

Example:
Issuing the command
? SET GRAPH
Produces information Related to the settings in graph files. 


Displaying StyleSheet Parameter Settings: The ? STYLE command displays the current settings for StyleSheet parameters.

Syntax:
? [SET] STYLE

Example:
Issuing the command
? STYLE
Produces information similar to the following:
                  STYLESHEET PARAMETER SETTINGS
 
ONLINE-FMT     HTML
OFFLINE-FMT    STANDARD
STYLESHEET     ON
SQUEEZE        OFF
LABELPROMPT    OFF
STYLEMODE      FULL
ORIENTATION    PORTRAIT
UNITS          INCHES
TOPMARGIN      .250
BOTTOMMARGIN   .250
LEFTMARGIN     .250
RIGHTMARGIN    .250
TARGETFRAME    ????
FOCEXURL       \cgi-bin\ibi_cgi\ibiweb.exe?IBIMR_drill=X,corp/corp.htm
BASEURL        OFF

The following StyleSheet information is listed:
ONLINE-FMT
Is the format of report output. Can produce output as HTML (the default), PDF, Excel 2000, Excel 97, PostScript, or as un-styled character-based output.
OFFLINE-FMT
Is the format of report output. Can produce output as HTML or as un-styled character-based output.
STYLESHEET
Rejects or accepts StyleSheet parameters that specify formatting options such as page size, orientation, and margins.
LABELPROMPT
Specifies on which label of the first page to begin printing a multi-pane report, such as a mailing label report.
STYLEMODE
Speeds the retrieval of large report output by displaying output in multiple HTML tables Where each table is a separate report page.
ORIENTATION
Is the page orientation for styled reports. Can be either portrait or landscape.
UNITS
Is the unit of measure for PostScript and PDF report output, as either inches, centimeters, or points.
TOPMARGIN
Is the top boundary for a page of report output.
BOTTOMMARGIN
Is the bottom boundary for a page of report output.
LEFTMARGIN
Is the left boundary for a page of report output.
RIGHTMARGIN
Is the right boundary for a page of report output.
TARGETFRAME
Is a frame to which all drill-down hyperlinks are directed.
FOCEXURL
Is the location of a procedure and the method used to execute it from the WebFOCUS Client.
BASEURL
Is the default location where the browser searches for relative URLs specified in the HTML documents created by your application.




Displaying Global Variable Values: The ? && command lists Dialogue Manager global variables and the current values. Global variables maintain the values for all procedures executed during a FOCUS session.
Note: You can query all Dialogue Manager variables (local, global, system, and statistical) from a stored procedure by issuing:
-? &

Syntax:
? &&
? %%
Your site may replace the ampersand (& or &&) indicating Dialogue Manager variables, with another symbol. In that case, use the replacement symbol in your query command. For example, if your installation uses the percent sign (%) to indicate Dialogue Manager variables, list global variables by issuing:
? %%

Example:
Issuing the command
? &&
Produces information similar to the following:
 &&CITY      ‘STAMFORD
&&CODE1      ‘B10’
&&CODE2      ‘B20’



Identifying the Files Being Used: You can debug your application by identifying the files you are using. You can identify the file name and location of a procedure, data source, Master File, Access File, or StyleSheet. WebFOCUS searches on the path of the WebFOCUS Reporting Sever and identifies the file using the WHENCE command.
The maximum length of the file name is 64 characters when using the WHENCE command.

Syntax for the Procedure Being Used
WHENCE Procedure FOCEXEC
Where:
Procedure -->Is a procedure.

Example:
Issuing the command
WHENCE FINANCE FOCEXEC
Produces output similar to the following:
C:\ibi\apps\session\layout.fex 

Syntax for the Data Source Being Used
WHENCE Focusfile FOCUS
Where:
Focusfile -->Is a FOCUS data source.

Example:
Issuing the command
WHENCE CENTINV FOCUS
Produces output similar to the following:
C:\ibi\apps\session\centinv.foc 

Syntax for the Master File Being Used
WHENCE Masterfile MASTER
Where:
Masterfile -->Is a Master File.

Example:
Issuing the command
WHENCE CENTINV MASTER
Produces output similar to the following:
C:\ibi\apps\session\centinv.mas 

Syntax for the Access File Being Used
WHENCE Accessfile ACCESS
Where:
Accessfile -->Is an Access File.

Example:
Issuing the command
WHENCE GKEIVP ACCESS
Produces output similar to the following:
C:\ibi\srv76\home\catalog\gkeivp.acx 

Syntax for the StyleSheet Being Used
WHENCE Stylesheet FOCSTYLE
Where:
Stylesheet -->Is a StyleSheet.

Example:
Issuing the command
WHENCE GGORDERS FOCSTYLE
Produces output similar to the following:
C:\ibi\apps\session\classic.sty 


Comments

Popular posts from this blog

IBI WebFOCUS - Functions available and syntax to use

IBI WebFOCUS - Difference (Preference) between Join and Match: