kviewinfo

The kviewinfo utility is used to generate a cross reference by function and view of where views are used. It can then recommend suitable views based on those views created. For each record it also tracks what views exist for the record and a histogram of how often each FLD from the record is used. Here is an example page.

Before running the utility you must first generate the raw view data by add the GenerateViewInfo flag to the flag section of your build.xml then run a full build using kmake. This will generate a .k7view XML file for each .kbin file built. It does slow down the build process slightly.

Then you can run the kviewinfo utility which will create a temporary subdirectory of the $KBIN output directory containing an XML file for each function and record. These XML files reference an XSLT stylesheet and can viewed in an XSLT enabled web browser like Mozilla, Firefox or IE5.5.

kmake -b K8-ORA-7 -a -i -k
kviewinfo -b K8-ORA-7

Command line switches

SwitchPurpose
-b systemBuild using the specified system name from kconf.xml
-fName of source file to output generated views to
-hGenerate viewinfo help files. Originally these were always generated, but creating the help files took longer than the rest of the process so this is now enabled by the option
-iDo not iterate. This is only used for debugging purposes
-nNumber of views to generate for each DEF DATABASE ROW
-sOperate silently without printing status or error messages
-uSpecify a build xml file directly rather than using a system name
-vPrint version information and terminate
-?Produce a usage message on standard output

View optimization

kviewinfo can also generate optimum views for a particular system. This will generate n optimum views for each DEF DATABASE ROW. Both n and the file to generate these views to must be specified by the user. As part of the process kviewinfo will generate a .viewpatch file per source file in the same directory as the source file. The patch file contains information for KCML on how to automatically apply the generated views to the system. To use the patch files you will need to set $OPTIONS_RUN_63=0x01 when building/using the system.

Example:
  1. Build system and run kviewinfo.
    kmake -b K8-ORA-7 -a -i -k
    kviewinfo -b K8-ORA-7 -n 30 -f c:/k8/sw/programs/genviews.src
    
  2. Add genviews.src to build.xml
  3. Clone service K8-ORA-7 as K8-ORA-7-PATCH in kconf.xml
  4. Add $OPTIONS_RUN_63=0x01 to K8-ORA-7-PATCH service.
  5. Build new system.
    kmake -b K8-ORA-7-PATCH -a -i -k
    

Exit codes

If kviewinfo encounters an error situation it will terminate setting its exit code to one of the following:

0Success
2Fatal error

See also:

DEFVIEW,
kmake