CacheOptionWeightedPercentages

Cache Job Competency Option Weighted Percentages

Minor Business Rule

Object Name: B0800222

Parent DLL: CHRM

Location: Client/Server

Language: C

Functional Description

Purpose

This function manages cache records for the job competency percent achieved for the options of a job 
competency code.  By using this function, records can be added, changed, retrieved, and deleted from 

the cache.


Setup Notes and Prerequisites


Special Logic




Technical Specification

• The 'Cache Cursor', Data Item 'GENLNG', must be passed the value '0' the first time the cache is 
initialized.  A value will be passed back that must be stored in a variable.  Each time this BSFN is 

called the value in that variable must be passed into the BSFN and a new value will be sent back to the 

variable.  This is the cache handle.  If the calling program needs more than one handle on the database 

at a time, then more than one GENLNG can be used.


• Use the following action codes to work with cache:
Cache Action Code, CACTN: '1' = Get Cache Record (using a full key)
'2' = Add Cache Record
'3' = Update Cache Record
'4' = Delete One Cache Record at a Time
'5' = Delete All Cache Records (The cache is left open)
'6' = Get Next Cache Record (using a partial key)

'7' = (Do Not Use)

'8' = End Cache (Cache is deleted and closed)

'9' = Close Cache Cursor


• The Cache Name should be the next number from X0010 passing in '00' for the System Code and '4' for 
the Next Number Index and then convert that number into a string.  Or use the function Get Internal 

Next Number and convert the number into a string.


• Return errors through Error Message ID, DTAI.

• The data can be accessed using the full key or a partial key using Number Keys and Index ID, to 
distinguish between a full or a partial fetch.  

• The following Indexes are defined:
• Index 1:  Job Competency Code, Option Number
• Index 2:  Job Competency Code, Weighted Option Percent
• Index 3:  Job Competency Code, Sort Number

• When adding a record always attempt to get the record first.  If no error is returned then the 
record already exists and it cannot be added.





Data Structure

D0800222 - Cache Job Competency Option Weighted Percentages

Parameter NameData ItemData TypeReq/OptI/O/Both
szCacheNamePIDcharREQBOTH

Cache Name - A unique name for this cache for this user.  Typically, this is 
created by calling the Get Internal Next Number business function and converting the 

result to a string.

szJobCompetencyCodeJCCcharOPTBOTH

Job Competency Code - The job competency code for this option record.

szOptionNumberCOPTNcharOPTBOTH

Option Number - The option for the job competency code.

mnWeightedOptionPercentJBPCTRQDMATH_NUMERICOPTBOTH

Weighted Option Percent - The calculated percent achieved for the employee 
competencies attached to this option.

szErrorMessageIDDTAIcharOPTOUTPUT

Error Message ID - Returns the error, if any, encountered during processing.  If 
an error is reached during Get Next, then the end of the selected records has been 

reached.

szCacheActionCodeCACTNcharREQINPUT

Cache Action Code - 
1 = Cache Get

2 = Cache Add

3 = Cache Update

4 = Cache Delete

5 = Cache Delete All

6 = Cache Get Next

7 = DO NOT USE

8 = Cache End

9 = Cache Close Cursor

mnIndexIDNKEYSMATH_NUMERICREQINPUT

Index ID - 
Index 1 - Job Competency Code, Option Number


Index 2 - Job Competency Code, Weighted Option Percent


Index 3 - Job Competency Code, Sort Number

mnNumberKeysNKEYSMATH_NUMERICREQINPUT

Number of Keys - The number of keys in the selected index being used for the 
current operation.  If the value is 1, then only the first key of the index is being 

used, if the value is 2, then the first and the second key are being used, and so 

on.


cSuppressErrorMessageSUPPScharOPTINPUT

Suppress Error Message - Enter a 1 to suppress the error messages.  Otherwise, 
errors will be set on the appropriate parameters when found.

idCacheCursorGENLNGIDREQBOTH

Cache Cursor - The cursor ID of the current cache record.  Used by Get Next to 
identify the location of the last record retrieved.


mnSortNumberJBPCTRQDMATH_NUMERICOPTBOTH

Sort Number - A calculated value that will cause the option with the highest 
weighted percentage to be fetched first if the cache is sorted by Job Competency Code 

and Sort Number.

Related Functions

None

Related Tables

None