[{TableOfContents }]
!!!LOAD BENEFIT ELECTIONS
!!Processing Information
The Load Benefit Elections (LBEN) screen is an extension of the technology used by [LMTD]. It was originally built for a particular client and thus was very customized. However, it has recently undergone some changes to make the LBEN more generic and powerful, like that of the [LMTD]. LBEN will now respect derivation expressions where as previous versions of the function did not.

The original LBEN still exists and is now known as LBEN_407. The new LBEN has the same functionality of the [LMTD] with the only exception that it is strictly used to update Benefit Elections. The LBEN has been designed to call the special benefit election logic which checks the schedule to ensure the employees are eligible for the benefit plans/coverages.

The LBEN does not update the elections in the same manner as [IBEL] does. The LBEN actually first attempts to update the election record with a new coverage, component amounts etc.…but it does not set the status to Elected. It is only in this way that the system can retain the election record in the table in time to update the associated election component records. Only after the LBEN updates the BELC record, does it go back and update the BEL record to Elected.

;Step 1 - Define Interface Format in [IDIF]
;:The interface format used for LBEN follows the same rules as that of the [LMTD]. Please review the [LMTD INTERFACE FORMAT] page which outlines what is required to be defined in [IDIF]. 
;Step 2 - Define Site Preferences in [IMST]
;:Within the [IMST] screen, the administrator must define where the Extract and Load files are located and where the load functions are to write the exception files to. These locations are used by the functions to create and retrieve information. The customer can modify these values to represent any directory on their system, which is convenient. 

;: The extract directory is defined using the [EXTRCT DATA FLDR] preference. The load directory is defined using the [LOAD DATA FLDR] preference. The [ATTACHMENTS FLDR] must be specified so the load functions know where to write the report exceptions log to.

;:If the full path is not specified here, then the path used by the HL Application Directory will apply. The user who is running the LBEN must have Read/Write/Create access to this directory on the server.

;Step 3 - Run LBEN to Load the Data
;:Launch the LBEN function specifying the appropriate parameters indicated below.

;Step 4 - Review Report & Exception File For Results
;:During the load process, all non-fatal exceptions as well as the number of insertions and updates (by table) are logged in the execution run logs. After the load process completes, a report is written to a pdf file and to a text file indicating the number of records read, number of records bypassed, number of records processed, number of records that were bypassed because an identical one already existed in the table, and number of records updated/inserted by table. The report will display all non-fatal business exceptions encountered during the load with a record number indicating for which record the exception occurred. The report will also display the amount of time that was taken for the load process to complete.

;:There are two tiers of exceptions that can be generated during the load process. The first tier involves the DIF Data Loader extracting and building data from the source file and the second involves the Data Loader processing the extracted data. However, there will only be ONE exception for each failed load. Basically, if the record fails to build data correctly on the DIF Data Loader, the program will not bother loading it so you will never see two exceptions for a single failed record load.

;:Exceptions generated on the DIF Loader will indicate that the exception occurred while "reading data from file". Exceptions generated on the Data Loader will indicate that the exception occurred while "loading data into the DB".

;:The report text file will be located in the directory which was specified in the [IMST] preference [LOAD DATA FLDR].

;:If records are not loaded due to errors, these bypassed records will be copied to a separate file which can be loaded once the records have been corrected. This allows you to load in just the bypassed records without having to manipulate the original file. The file name will be the original file name prefixed with the mex id and suffixed with _BYPASSED.txt, for example 9916_iptl.csv_BYPASSED.txt. This file will be stored in the [LOAD DATA FLDR] folder on the server. This file will only be created for the Dif Data Loader processes, it will not be created if using the Table Data Loader.

;Step 5 - Verify Data Has Been Loaded
;:If there are no exceptions in the report, you should navigate to the table where the data was loaded and verify that the load was done correctly.

----
!!Report Parameters
||Report Parameters||
|Server File| This field provides the name of the file that has been placed on the server\\ in the directory specified in the [IMST] record [LOAD DATA FLDR].
|Local File| This field allows you to upload a local source file for loading into the database\\ (similar to that of WW Reports in EP). To do this, you must populate the\\ 'Local File' field by selecting the local source file using the file chooser. When \\selecting a local source file to load, the 'Server File' field MUST be blank.
|Exception Level| Lexicon value of 0 to 9. Allows you to specify the level of trace you wish to see \\in the report. 1-User Trace is the suggested level of trace to be selected.
|Interface Code| An Interface Code must be specified when using the DIF Data Loader logic. You can select multiple interfaces if you have to run a particular source file multiple times using different interfaces. If the source file has thousands of records
it is suggested to run the LBEN multiple times selecting only one interface code each time otherwise there may be an impact on performance.
|File Format| Lexicon value of Character-delimited or Fixed Position.
|Delimiter| Indicates the delimiter in the file if it is not a Fixed Format.

----
!!Business Scenarios For LBEN
Here are a few examples of interface formats used to load data into the [P2K_BE_ELECTIONS] table. Please note that these may not include all available columns on the table, just a few that were selected to update or insert. 
#[Loading Elections & Election Component Amounts into IBEL|LOADING ELECTIONS AND COMPONENT AMOUNTS INTO IBEL]
#[Loading Elections Only|LOADING ELECTIONS ONLY]
#[Unenrolling Employee Benefit Elections|UNENROLL EMPLOYEE BENEFIT ELECTIONS]

[{If var='loginstatus' contains 'authenticated'

----
![Discussion|Edit:Internal.LBEN] 	
[{InsertPage page='Internal.LBEN' default='Click to create a new discussion page'}] 	

}]