Script Helper
Sample BenSelect® scripts with notes on how they work, where they go and what to change. Search by keyword or by tag — try or .
Date as MM/dd/yyyy
Formats a record date field in US format, blank when empty.
Date as yyyyMMdd (EDI style)
Formats a date as CCYYMMDD, the common EDI/834 date format.
SSN as 9 digits, no dashes
Strips dashes/spaces and left-pads an SSN to 9 digits.
ZIP+4 formatting
Turns a 9-digit ZIP into #####-####; trims longer/odd values to 5 digits.
Phone as (###) ###-####
Formats a 10-digit stored phone number.
Skip never-effective coverage
Drops rows where coverage ended on or before it started.
Skip ACD carry-forward rows
In ACD (changes-only) runs, suppress rows that are just carry-forwards.
Only emit the last record per employee
Collapse multi-row employees down to one row.
Initialize / clear globals per employee
Reset per-employee working values at the start of each employee.
Dependent age
Calculates a child dependent's age as of the effective date.
Flatten dependents onto one row
Store each dependent row in Globals, emit one row per employee, and read Dep1..DepN in other fields.
Pick one of two pipe-separated deduction codes
Deduction codes stored as 'A|B' — choose based on the deduction option code.
ACD status to A / C / T
Maps ACDStatus (1 add, 2 change, 3 term) to single-letter carrier codes.
Relationship to 834 relationship code
Maps BenSelect relationship IDs to common ANSI 834 INS02 codes.
Coverage tier to carrier tier code
Maps CoverageTypeID to the carrier's tier codes.
Fixed-width field (pad/truncate)
Forces a value to exactly N characters for fixed-width layouts.
Running record sequence number
Outputs 1, 2, 3… across the file; the final value is the total record count.
Debug: dump all globals on the last record
Writes every global key/value to the debug output at the end of the run.
Question answer as Y/N
Outputs a Yes/No question answer as Y/N.