The Insurance Management System (INSMASTR) is a comprehensive, enterprise-grade mainframe application built for IBM z/OS environments. It implements a batch processing architecture that handles three core insurance operations: policy creation, policy renewal, and claims management with integrated fraud detection capabilities.
| Characteristic | Details |
|---|---|
| Architecture Style | Batch-oriented, transaction-based processing |
| Processing Model | Sequential file processing with database persistence |
| Data Management | Hybrid architecture combining sequential files and DB2 relational database |
| Scale | Designed for high-volume batch processing with commit points every 500 records |
| Integration | File-based input/output with DB2 database for persistent storage |
| Language | COBOL V6.3+ (IBM Enterprise COBOL) |
| Database | DB2 V12+ for z/OS |
| Platform | IBM z/OS mainframe operating system |
The system provides the following core capabilities:
The Insurance Management System serves as the primary batch processing engine for insurance operations, handling end-to-end processing workflows for policies, renewals, and claims.
The program supports four operational modes controlled via JCL PARM parameter:
| Mode | Description | Use Case |
|---|---|---|
| POLICY | Process only policy files | New policy application processing |
| RENEWAL | Process only renewal files | Policy renewal batch runs |
| CLAIM | Process only claims files | Claims processing batch runs |
| ALL | Process all three file types | End-of-day comprehensive processing |
| Component | Details |
|---|---|
| Language | COBOL (COmmon Business-Oriented Language) |
| Version | IBM Enterprise COBOL for z/OS V6.3+ |
| Compiler Features | DEBUGGING MODE enabled |
| COBOL Features Used | EVALUATE, SEARCH, COMPUTE, intrinsic functions, level-88 conditions |
| Component | Details |
|---|---|
| Database | IBM DB2 for z/OS V12+ |
| Database Name | INSPROD (Production) |
| Integration Method | Embedded SQL via DB2 precompiler |
| Isolation Level | CS (Cursor Stability) |
| Lock Timeout | 30 seconds |
| Transaction Control | Explicit COMMIT/ROLLBACK |
| Features Used | Sequences, MERGE statements, date arithmetic |
| Component | Details |
|---|---|
| Operating System | IBM z/OS |
| Job Control | JCL (Job Control Language) |
| File Organization | Sequential (VSAM/PS) |
| Recording Mode | Fixed block format (F/FBA) |
| Tool | Purpose |
|---|---|
| DB2 Precompiler | Processes EXEC SQL statements |
| COBOL Compiler | IBM COBOLCOMP (IGYCRCTL) |
| Bind Utility | Creates DB2 application plans |
| Link Editor | Creates executable load modules |
The following diagram illustrates the INSMASTR program within its operational environment, showing all external interfaces:
| File | DD Name | Record Length | Organization | Purpose |
|---|---|---|---|---|
| Policy Input | POLFILE | 800 bytes | Sequential | New policy applications with customer data |
| Renewal Input | RENFILE | 600 bytes | Sequential | Policy renewal requests |
| Claims Input | CLMFILE | 900 bytes | Sequential | Insurance claim submissions |
| File | DD Name | Record Length | Format | Purpose |
|---|---|---|---|---|
| Policy Output | POLOUT | 500 bytes | Fixed | Processed policy confirmations |
| Renewal Output | RENOUT | 500 bytes | Fixed | Renewal processing results |
| Claims Output | CLMOUT | 500 bytes | Fixed | Claim adjudication results |
| Error Log | ERRFILE | 250 bytes | Fixed | Validation and processing errors |
| Summary Report | RPTFILE | 133 bytes | FBA | Processing statistics and summary |
The INSMASTR program follows a modular, section-based architecture typical of structured COBOL programs:
| Component Series | Lines | Purpose | Key Functions |
|---|---|---|---|
| 1000-Series: Initialization | 885-1133 | System bootstrap and setup | Mode determination, file opening, DB2 connection, rate table initialization, report headers |
| 2000-Series: Policy Processing | 1139-1760 | New policy creation | Validation, duplicate checking, risk scoring, premium calculation, customer management, policy insertion |
| 3000-Series: Renewal Processing | 1766-2191 | Policy renewal handling | Validation, policy retrieval, renewal premium calculation with discounts, new policy creation, status updates |
| 4000-Series: Claims Processing | 2197-2846 | Claims adjudication | Validation, policy verification, duplicate detection, fraud detection, payment calculation, claim recording |
| 7000-Series: Transaction Management | 2852-2867 | DB2 commit operations | Batch commit handling (every 500 records), transaction boundary coordination |
| 8000-Series: Error Management | 2873-2941 | Central error handling | Error severity classification, logging, automatic rollback, program abort for critical errors |
| 9000-Series: Finalization | 2947-3228 | Cleanup and reporting | Final commit, summary reports, file closure, DB2 disconnection, return code determination |
| Parameter | Value | Purpose |
|---|---|---|
| WS-COMMIT-FREQUENCY | 500 records | Commit interval for batch transactions |
| WS-MAX-RETRIES | 3 | Maximum retry attempts for recoverable errors |
| WS-MAX-COVERAGE | $999,999,999 | Maximum allowed coverage amount |
| WS-MIN-AGE | 18 years | Minimum age for policy applicants |
| WS-MAX-AGE | 85 years | Maximum age for policy applicants |
| WS-FRAUD-THRESHOLD | 70 points | Fraud score threshold for investigation |
| WS-AUTO-APPROVE-LIMIT | $5,000 | Auto-approval limit for claims |
| Setting | Value | Purpose |
|---|---|---|
| Database Name | INSPROD | Production insurance database |
| User ID | INSMASTR | Program-based authentication |
| Isolation Level | CS (Cursor Stability) | Balance between consistency and concurrency |
| Lock Timeout | 30 seconds | Prevent indefinite lock waits |
| Connection Type | Named connection | Explicit connection management |
| Aspect | Configuration |
|---|---|
| Organization | Sequential (ORGANIZATION IS SEQUENTIAL) |
| Access Mode | Sequential (ACCESS MODE IS SEQUENTIAL) |
| Recording Mode | Fixed (F) or Fixed Block with ANSI control (FBA) |
| Block Size | System-determined (BLOCK CONTAINS 0) |
| Label Records | Standard labels |
The system uses five primary DB2 tables with relationships maintained through foreign keys:
| Table | Purpose | Key Features | Lines Referenced |
|---|---|---|---|
| POLICY_TABLE | Stores all policy records | Policy lifecycle tracking, renewal chain links, risk/fraud scores | 640-665 |
| CUSTOMER_TABLE | Customer master data | MERGE operations for upsert, fraud alert tracking | 701-715 |
| CLAIM_TABLE | Claims transactions | Fraud detection flags, payment breakdown, approval workflow | 669-696 |
| PROVIDER_TABLE | Healthcare provider registry | Fraud scoring, network status, provider ratings | 720-727 |
| AUDIT_TABLE | Compliance audit trail | All changes tracked for regulatory compliance | Referenced line 24 |
| Operation Type | Usage Pattern | Examples |
|---|---|---|
| SELECT | Policy/claim lookups, duplicate checks, fraud queries | Duplicate policy check (1358-1365), Policy retrieval (1906-1920), Fraud detection queries (2460-2521) |
| INSERT | New record creation | Policy creation (1697-1719), Claim recording (2718-2747) |
| UPDATE | Status and usage tracking | Policy status update (2146-2153), Policy usage tracking (2774-2785) |
| MERGE | Customer upsert operations | Customer create/update (1597-1629) |
| SEQUENCES | Primary key generation | POLICY_SEQ (1645-1649), CLAIM_SEQ (2675-2679) |
The system implements a classic batch processing architecture with the following characteristics:
| Aspect | Configuration | Rationale |
|---|---|---|
| Commit Frequency | Every 500 records | Balances throughput with rollback risk |
| Commit Type | Explicit batch commits | Reduces lock contention on DB2 tables |
| Transaction Boundaries | Defined by commit points | Enables restart/recovery from checkpoints |
| Configurable | WS-COMMIT-FREQUENCY constant | Tunable based on workload characteristics |
| Error Type | Handling Approach | Result |
|---|---|---|
| Record-level errors | Log and continue | Maximizes successful processing |
| Database errors | Automatic rollback | Maintains data consistency |
| Critical errors | Immediate program abort | Prevents data corruption |
| File I/O errors | Error handler invocation | Graceful degradation |
| Processing Type | Estimated Throughput | Factors |
|---|---|---|
| Policy Processing | 1,000-2,000 records/hour | Light DB activity: 2-3 SELECTs + 2 INSERTs per record |
| Renewal Processing | 2,000-3,000 records/hour | Moderate DB activity: 2-3 SELECTs + 2 UPDATEs per record |
| Claims Processing | 500-1,000 records/hour | Heavy DB activity: 6-8 SELECTs + 2 INSERTs per record (fraud detection bottleneck) |
| Resource | Utilization Level | Notes |
|---|---|---|
| CPU | Moderate | Calculation-intensive (premiums, risk scores) |
| I/O | High | Sequential file access + DB2 queries |
| Memory | Fixed | COBOL program size (resident) |
| Database Connections | 1 per job instance | Named connection to INSPROD |
| Database Locks | Low | Cursor Stability isolation, 30-second timeout |
The system implements a configurable commit strategy:
| Boundary Type | Trigger | Purpose |
|---|---|---|
| Batch Commit | Every 500 records | Prevents long-running transactions |
| Final Commit | Program finalization | Commits pending changes before exit |
| Automatic Rollback | Database error (SQLCODE < 0) | Maintains data consistency |
| Implicit Savepoint | Each commit | Enables partial recovery |
Implementation:
Rationale:
Trade-offs:
| Layer | Responsibility | Components |
|---|---|---|
| Presentation Layer | File I/O and formatting | File read/write sections, record structures |
| Business Logic Layer | Validation, calculation, fraud detection | Risk scoring, premium calculation, fraud detection |
| Data Layer | DB2 operations | SELECT, INSERT, UPDATE, MERGE statements |
Benefits:
Implementation:
Benefits:
Code Pattern:
IF error-condition
MOVE error-code TO WS-ERROR-CODE
MOVE error-message TO WS-ERROR-MESSAGE
PERFORM 8000-ERROR-HANDLER
END-IF
Implementation:
Examples:
Benefits:
Implementation:
Design Decision:
Record count-based commits chosen over time-based
Rationale: Predictable recovery points
Alternative considered: Time-based (rejected due to unpredictability)
| Consideration | Analysis |
|---|---|
| Decision | Fixed commit interval every 500 records |
| Rationale | Balances throughput with recovery granularity |
| Alternative Considered | Time-based commits (e.g., every 60 seconds) |
| Why Rejected | Unpredictable recovery points, variable transaction sizes |
| Tuning Guidance | Increase for higher throughput, decrease for faster recovery |
| Consideration | Analysis |
|---|---|
| Decision | Use MERGE statement for customer records |
| Rationale | Atomic upsert operation, simplified code |
| Alternative Considered | SELECT to check existence, then INSERT or UPDATE |
| Why Rejected | Race conditions, more complex logic, higher DB round-trips |
| Performance Impact | Single DB operation vs. two operations |
| Consideration | Analysis |
|---|---|
| Decision | Hardcode rate tables in program working storage |
| Rationale | Initialization performance, no external dependencies |
| Alternative Considered | Load from database or configuration file |
| Why Rejected | Slower startup, additional I/O overhead |
| Trade-off | Less flexible but faster, requires recompile for rate changes |
| Component | Weight | Purpose |
|---|---|---|
| Claim Frequency | Up to 25 points | Detects abnormal claim patterns |
| Claim Amount | Up to 15 points | Flags unusually high amounts |
| Provider History | Up to 20 points | Leverages provider fraud scores |
| Pattern Detection | Up to 20 points | Identifies duplicate/similar claims |
| Timing Analysis | Up to 5 points | Analyzes claim submission timing |
Rationale: Composite scoring reduces false positives while maintaining detection effectiveness
| Approach | Implementation |
|---|---|
| Strategy | Continue processing after non-critical errors |
| Implementation | Error flag reset after logging, processing continues |
| Benefit | Maximizes successful record processing |
| Trade-off | Mixed success/failure batches require reconciliation |
| Use Case | Validation errors shouldn't block entire batch |
| Metric | Current Capability | Limiting Factor |
|---|---|---|
| Policy Processing | 1,000-2,000/hour | Sequential file I/O + DB2 response time |
| Renewal Processing | 2,000-3,000/hour | DB2 query complexity |
| Claims Processing | 500-1,000/hour | Fraud detection queries (6-8 DB hits/record) |
| Commit Overhead | Every 500 records | DB2 transaction log management |
Capability:
Implementation:
Job Instance 1: PARM='POLICY' - Process new policies
Job Instance 2: PARM='RENEWAL' - Process renewals
Job Instance 3: PARM='CLAIM' - Process claims
Constraints:
Options:
| Approach | Method | Impact |
|---|---|---|
| Commit Frequency | Increase WS-COMMIT-FREQUENCY | Higher throughput, larger rollback risk |
| DB2 Tuning | Buffer pool optimization | Faster query response |
| File Buffering | Increase BLOCK SIZE | Reduced I/O operations |
| CPU Allocation | z/OS workload manager | More CPU cycles for processing |
| Memory Allocation | Region size increase | Larger data areas if needed |
Indexing Strategy:
| Index Type | Columns | Purpose | Impact |
|---|---|---|---|
| Primary Keys | POLICY_NUMBER, CLAIM_ID, CUSTOMER_NUMBER | Unique identification | Mandatory for performance |
| Foreign Keys | Customer/policy relationships | Join optimization | Improves query speed |
| Fraud Queries | CLAIM_DATE, CUSTOMER_NUMBER | Frequency analysis | Critical for fraud detection |
| Composite | CUSTOMER_NUMBER + CLAIM_TYPE + CLAIM_DATE | Pattern detection | Reduces fraud query time |
Partitioning Strategy:
| Table | Partition Key | Rationale |
|---|---|---|
| POLICY_TABLE | POLICY_START_DATE | Distribute by time period |
| CLAIM_TABLE | CLAIM_DATE | Most recent data accessed frequently |
| CUSTOMER_TABLE | CUSTOMER_NUMBER ranges | Distribute by customer segments |
Query Optimization:
Current bottleneck: Fraud detection requires 6-8 DB2 queries per claim
Optimization Options:
Current State:
SELECT COUNT(*) - Claim frequency check
SELECT COUNT(*) - Provider fraud score
SELECT COUNT(*) - Pattern detection
SELECT COUNT(*) - Similar claims analysis
(4 separate queries per claim)
Proposed Optimization:
-- Single query with subqueries or CTEs
WITH claim_stats AS (
SELECT customer_number,
COUNT(*) as claim_count_30d,
COUNT(CASE WHEN similar conditions END) as pattern_count
FROM claim_table
WHERE ...
),
provider_stats AS (
SELECT provider_code, fraud_score
FROM provider_table
)
SELECT * FROM claim_stats JOIN provider_stats ...
Expected Impact: 50-70% reduction in claims processing time
Current: Single-threaded sequential
Proposed: Multi-threading or parallel job instances
Implementation Approach:
Expected Impact: Linear throughput improvement (2x jobs = 2x throughput)
| Data Type | Current | Proposed | Benefit |
|---|---|---|---|
| Rate Tables | Loaded at init | Already optimal | N/A |
| Provider Fraud Scores | Query per claim | Cache in memory array | Reduce DB hits |
| Customer Risk Profiles | Query per policy | Cache recent customers | Faster policy processing |
| State Tax Rates | Table lookup | Already optimal | N/A |
Current: Individual INSERT/UPDATE statements
Proposed: Multi-row inserts where supported
DB2 Compatibility: Check DB2 version for multi-row INSERT support
Expected Impact: 15-25% reduction in commit overhead
Current: Fixed 500 records
Proposed: Adaptive based on record complexity
Algorithm:
IF claims processing (complex):
Commit every 250 records
ELSE IF policy processing (moderate):
Commit every 500 records
ELSE IF renewal processing (simple):
Commit every 1000 records
Expected Impact: Better balance of throughput vs. risk
| Scenario | Monthly Volume | Required Processing | Scaling Recommendation |
|---|---|---|---|
| 1M policies/month | ~33,000/day | 20 job runs/day @ 2,000/hour | 2-3 parallel policy jobs |
| 500K renewals/month | ~17,000/day | 6 job runs/day @ 3,000/hour | Single renewal job sufficient |
| 100K claims/month | ~3,300/day | 5 job runs/day @ 1,000/hour | Single claims job, optimize fraud detection |
| Growth: 50% YoY | All volumes × 1.5 | Review annually | Plan for parallel processing |
| Volume Level | CPU | Memory | DB2 Connections | Disk I/O |
|---|---|---|---|---|
| Current (baseline) | 1 CPU | 128 MB | 1 | Medium |
| 2x volume | 2 CPUs | 256 MB | 2-3 | High |
| 5x volume | 4-5 CPUs | 512 MB | 5-6 | Very High |
| 10x volume | 8-10 CPUs | 1 GB | 10-12 | Requires optimization |
| Security Layer | Implementation | Status |
|---|---|---|
| DB2 Authentication | User ID: INSMASTR | Implemented |
| File-Level Security | z/OS RACF permissions | Relies on OS |
| Credential Management | No hardcoded credentials | Secure |
| Audit Trail | CREATED_BY/UPDATED_BY fields in all tables | Implemented |
| Data Type | Current State | Risk Level | Recommendation |
|---|---|---|---|
| Customer SSN | Stored unencrypted (line 331) | HIGH - PII | Encrypt at rest |
| Customer Contact Info | Plain text | MEDIUM - PII | Consider masking in logs |
| Medical Claims Data | Plain text | HIGH - PHI/HIPAA | Encrypt at rest |
| Diagnosis/Procedure Codes | Plain text | HIGH - PHI | Encrypt at rest |
| Financial Data | Plain text | MEDIUM | Encrypt sensitive amounts |
Encryption Status: No explicit encryption mentioned in code
All database tables include comprehensive audit fields:
| Field | Purpose | Implementation |
|---|---|---|
| CREATED_DATE | Record creation timestamp | DB2 CURRENT_TIMESTAMP |
| CREATED_BY | User who created record | WS-PROGRAM-NAME ('INSMASTR') |
| LAST_UPDATE_DATE | Last modification timestamp | DB2 CURRENT_TIMESTAMP |
| UPDATED_BY | User who modified record | WS-PROGRAM-NAME |
Additional Audit:
| Requirement | Current Implementation | Gap Analysis |
|---|---|---|
| Medical Data Protection | Claims processing with diagnosis/procedure codes | No encryption at rest |
| Access Control | DB2 authentication | No role-based access control |
| Audit Trail | Comprehensive logging | Implemented |
| Data Retention | All records persist | No explicit retention policy |
| Breach Notification | Not addressed | Policy needed |
Critical Gap: No evidence of encryption for PHI (Protected Health Information)
| Requirement | Current Implementation | Status |
|---|---|---|
| Audit Trail | All changes tracked with user/timestamp | Compliant |
| Separation of Duties | Batch processing separate from data access | Compliant |
| Error Logging | Comprehensive error file | Compliant |
| Change Management | Version control (V3.0) | Implemented |
| Requirement | Current Implementation | Status |
|---|---|---|
| Payment Method Storage | Stored as code (not full card number) | Assumed compliant |
| Cardholder Data | No evidence of full PAN storage | Assumed compliant |
| Access Logs | Audit trail present | Compliant |
Current State:
Recommendations:
Encrypt Sensitive Data at Rest
Implement Data Masking
Enhanced Authentication
Data Retention Policies
Enhanced Audit Logging
Digital Signatures
Network Security
Intrusion Detection
Disaster Recovery
| Constant | Value | Purpose | Line |
|---|---|---|---|
| WS-PROGRAM-NAME | 'INSMASTR' | Program identification | 213 |
| WS-VERSION | '03.00' | Version number | 214 |
| WS-RELEASE-DATE | '2024-01-15' | Release date | 215 |
| WS-MAX-RETRIES | 3 | Maximum retry attempts | 216 |
| WS-COMMIT-FREQUENCY | 500 | Records per commit | 220 |
| WS-MAX-COVERAGE | 999,999,999 | Maximum policy coverage | 217 |
| WS-MIN-AGE | 18 | Minimum applicant age | 218 |
| WS-MAX-AGE | 85 | Maximum applicant age | 219 |
| WS-FRAUD-THRESHOLD | 70 | Fraud investigation threshold | 221 |
| WS-AUTO-APPROVE-LIMIT | 5,000 | Auto-approval limit for claims | 222 |
| Return Code | Meaning | Condition |
|---|---|---|
| 0 | Successful completion | No errors, all records processed |
| 4 | Partial success | Some records had errors, but processing completed |
| 8 | Major failure | All records failed OR invalid processing mode |
| 12 | Critical file error | File open failure, cannot proceed |
| 16 | Abnormal termination | Critical error, program aborted |
| Operation | Count | Purpose |
|---|---|---|
| CONNECT | 1 | Database connection at startup |
| SELECT | 8+ | Policy/claim lookups, fraud queries |
| INSERT | 3 | Policy, claim record creation |
| UPDATE | 2 | Policy status, usage tracking |
| MERGE | 1 | Customer upsert |
| COMMIT | Variable | Every 500 records + final commit |
| ROLLBACK | As needed | On database errors |
| DISCONNECT | 1 | At program finalization |
| JCL PARM | Processes | Files Read | Files Written | Use Case |
|---|---|---|---|---|
| 'POLICY' | Policies only | POLFILE | POLOUT, ERRFILE, RPTFILE | New applications batch |
| 'RENEWAL' | Renewals only | RENFILE | RENOUT, ERRFILE, RPTFILE | Renewal processing |
| 'CLAIM' | Claims only | CLMFILE | CLMOUT, ERRFILE, RPTFILE | Claims batch |
| 'ALL' | All three | All input files | All output files | End-of-day processing |
| Section | Lines | Purpose | Dependencies |
|---|---|---|---|
| 0000-MAIN-CONTROL | 853-879 | Program orchestration | All subsections |
| 1000-INITIALIZE-PROGRAM | 885-948 | System bootstrap | File system, DB2 |
| 2130-CALCULATE-RISK-SCORE | 1388-1444 | Multi-factor risk assessment | Rate tables |
| 2140-CALCULATE-POLICY-PREMIUM | 1450-1551 | Premium calculation algorithm | Risk score, rate tables |
| 3130-CALCULATE-RENEWAL-PREMIUM | 1948-2045 | Renewal premium with discounts | Existing policy data |
| 4140-FRAUD-DETECTION | 2454-2561 | 4-component fraud analysis | DB2 queries, provider data |
| 4150-CALCULATE-CLAIM-PAYMENT | 2567-2665 | Payment calculation with OOP | Policy coverage data |
| 7000-COMMIT-WORK | 2852-2867 | Transaction commit | DB2 connection |
| 8000-ERROR-HANDLER | 2873-2941 | Central error management | Error log file |