You are here: Development Standards > Routines > Application-SpecificRoutines > BKAUDDOC.PUB

# BKAUDDOC.PUB

BKAUDDOC.PUB is a public program that handles a variety of functions for the Audit Document Links function. This program is called by RMDOAUD and RMDOAUD1, and handles all document links found in the Bills of Materials/Kitting module.

FILE_CHECK:

This entry point returns the total number of files in Bills of Materials that will be used to audit document links.

`1010 FILE_CHECK:`
`1030 ENTER APPFILES`

Variable | Description
APPFILES | The number of data files to open

Exit Points | Explanation
EXIT | FILE_CHECK normally exits with no error.

FILE_DATA:

This entry point will set the exact file names into an array and return those names to the calling program, which will in turn open the returned files.

`1510 FILE_DATA:`
`1530 ENTER APPFILES,DATAFILE$[ALL]`

Variable | Description
APPFILES | The number of data files to open (retrieved from using the FILE_CHECK entry point)
DATAFILE$[ALL] | A two-dimensional array dimensioned to DATAFILE$[1:APPFILES,1:2] DATAFILE$[x,1] = Name of file to be opened DATAFILE$[x,2] = "1" if file is encrypted, "" if not DATAFILE$[x,3] = String template key in OSTPL$

AUDIT:

This entry point will perform the auditing of data files within Bills of Materials.

`2010 AUDIT:`
`2030 ENTER MSG$,OUTPUT$,FILE[ALL],TEMPLATE$[ALL],PURGE$`

Variable | Description
MSG$ | Returns an error message if audit was able to perform
OUTPUT$ | Template hodling print information for report
FILE[ALL] | Standard file array
TEMPLATE$[ALL] | Array holding each string template of the corresponding files returned from the FILE_DATA entry point. Each template is on an index that corresponds to the FILE[ALL] array where the file is opened on
PURGE$ | Set to "R" to print audit report only, or "P" to purge documents and print report.

The OUTPUT$ template has the following format:

Field | Description
PCHAN:N(3*) | Output channel for report (Set to variable F)
DATE:C(10*) | Current workstation date
TIME:C(8*) | Current OS time
CNAME:C(40*) | Company Name
TITLE:C(40*) | Title of report (Set to variable OT$)
PAGE:N(4*) | Current page number of report
APPID:C(2*) | Current application ID
APPNAME:C(40*) | Current application name
APPINST:N(1*) | Installation flag for the current application
LNCOUNT:N(3*) | Current line count
PGLINES:N(3*) | Number of lines per page
FIRSTPG:N(1*) | Set to 1 when on page 1, otherwise set to 0
FILESEC:N(1*) | Set to 1 when printing a file section of the report

The AUDIT entry point of BKAUDDOC.PUB performs the following functions:

- Retrieves templates to use by Audit Document Links report by calling RMDOAUD.PUB::DIM_VARS
- Finds the FILE[ALL] elements that each appliation data file is opened on
- Audits document links of each document file, checking if the document exists

The data file that contain documents is the BKMHx.UD file.