SAM quarterly return: group scheme movements
Insurance South Africa
Works out sheets M1.2 and M2.2 of the SAM quarterly return, the number of schemes and premiums for group business, from a life insurer’s scheme listings. It checks each scheme’s status, dates and premiums against its movement, that the movements explain the change from the start of the quarter to the end, and that the start matches last quarter’s end.
From the Prudential Authority’s Quarterly Solo Quantitative Reporting Template v3, sheets M1.2 and M2.2, and their formulas for the end of the quarter
- 19validation rules
- 13pipeline stages
- 5group lines of business
- 3 minto build and check
See it in Quantemplate
The pipeline

The test run’s checks

The M1.2 and M2.2 output

What it checks
19 rules 11 Fail 8 Warning
- Fields and codesA scheme number given once, a product that’s in the products table and is group business on a line that M1.2 and M2.2 report, and valid in-force flags and movement code 6 Fail 6
- DatesThe quarter end and movement dates are dates, and movements fall in the quarter 2 Fail, 1 Warning 3
- Status and movementsEach scheme is in force at the start and end of the quarter as its movement says 0 Fail, 3 Warning 3
- PremiumsPremiums are numbers, schemes in force have a premium, and premium changes are recorded 1 Fail, 2 Warning 3
- TotalsSchemes and premiums at the end follow from the movements, and the start matches last quarter’s end 2 Fail, 2 Warning 4
A rule set to Fail marks its rows as failed, and any failure blocks Auto Export if you set it up. Warnings are only reported. Validation never removes a row. Every rule and its formula is listed in VALIDATIONS.md in the download.
How the pipeline works
- Stages 1–2 Read schemes Remove blank rows, detect the header, add each file’s name and stack the listings
- Stages 3–6 Products and counts Match each scheme to its product and line of business, and count the rows for each scheme number
- Stages 7–8 Check schemes Work out each scheme’s share of every M1.2 and M2.2 column, and run the 15 scheme checks. Output: every scheme
- Stages 9–11 Movements Total the schemes by line of business, and bring in last quarter’s figures
- Stages 12–13 M1.2 and M2.2 Check that the movements explain the end of the quarter and that the start matches last quarter, and run the 4 total checks. Output: one row per line of business, with premiums in R’000
The scheme listing’s columns
Each group business system gives a scheme listing for the quarter as a CSV file, with one row per scheme. A scheme number appears once across all the files.
Column |
What it holds |
|---|---|
Scheme Number |
The scheme’s number |
Scheme Name |
The scheme’s name, usually the employer or fund. It isn’t checked |
Product Code |
Your product code, as in the products dataset |
Quarter End |
The last day of the quarter, as yyyy-mm-dd, such as 2026-09-30 |
In Force at Start |
Y if the scheme was in force at the start of the quarter, otherwise N |
Start Premium |
The scheme’s annual premium in rand at the start of the quarter. Blank for a scheme not in force |
Movement |
What changed the scheme in the quarter, as one of the codes below. Blank for no movement |
Movement Date |
The date of the movement, as yyyy-mm-dd |
In Force at End |
Y if the scheme is in force at the end of the quarter, otherwise N |
End Premium |
The scheme’s annual premium in rand at the end of the quarter |
Each movement code counts towards a column of M1.2 and M2.2. Codes and the Y and N flags can be in any case: the pipeline trims them and puts them in capitals.
Movement |
Column on M1.2 and M2.2 |
|---|---|
NEW |
New schemes |
TERMINATION |
Terminations |
TRANSFER IN, TRANSFER OUT |
Transfers in terms of the Act: a transfer in is added and a transfer out is taken off |
SECTION 14 IN, SECTION 14 OUT |
Section 14 transfers, under section 14 of the Pension Funds Act: a transfer in is added and a transfer out is taken off |
PREMIUM CHANGE |
Premium increases or decreases, on M2.2 only |
OTHER |
Other movements: the change from the start of the quarter to the end |
What’s in the download
- The 19 rules as JSON, and a table of every rule with its formula, notes and source
- A table of 20 products, each mapped to its SAM line of business and its row on M1.2 and M2.2 and marked individual or group business, and last quarter’s figures at the end of the quarter
- Two fictional scheme listings for the quarter ending 30 September 2026, from a made-up insurer’s employee benefits and retirement fund systems, which pass every rule, and the M1.2 and M2.2 figures they give
- The same listings with a case for each rule, and the rows each rule should flag on them
- A template file the Quantemplate build skill reads to build the pipeline and check the results
- A snapshot of the finished pipeline, and the Python scripts that generate everything in the download
The PA’s quarterly template isn’t included. Download the current version from the PA’s insurer returns page.
Build it
- Install the Quantemplate skills, version 1.0.0 or later, if you haven’t already. Then unzip the download.
- With Claude in Chrome signed in to Quantemplate, ask Claude Code:
Build the SAM group scheme movements pipeline from the sam-group-movements folder. Test it with the test scheme listings and the clean ones and compare the results with the expected ones.
- Claude creates the products and previous quarter datasets, uploads the two test listings, builds the 13 stages and checks the test listings and the clean ones. This takes around 3 minutes.
The agent builds through the Quantemplate app’s own API in your browser. That API isn’t published, so if a release changes it, the build stops and tells you what went wrong. Review what the agent builds before you rely on it.
Using your own scheme data
- Upload each system’s scheme listing to stage 1 under a test file’s name, such as
swartberg-benefits-schemes-test.csv, which replaces it. Or upload it under its own name, tick it in stage 1’s inputs and untick the test files. - Replace the data of the SAM Group Products dataset with your own products, each with its SAM line of business, template row and whether it’s individual or group business. Drag your file onto the dataset to replace its data. It has the same columns as the life policy movements template’s products dataset, so one file can serve both.
- Each quarter, replace the data of SAM Previous Quarter Group Movements with last quarter’s M1.2 and M2.2 figures at the end of the quarter, as filed, with the premiums in R’000.
- Check the validation report’s Fail rules first: they mark schemes that can’t be placed and movements that don’t add up. Warnings are worth checking before you file.
- The M1.2 and M2.2 output has one row per group line of business, with its template row. Copy each row’s scheme counts to columns E to I and K of M1.2, and its premiums to columns E to K of M2.2. The template works out column L, the end of the quarter, which should match the output’s Schemes at End and Premiums at End.
Contact the Quantemplate support team, or use your AI agent, to build custom logic for your use case.
Limits
- It covers group business only: lines 1c, 1f, 1i, 2a and 3c, the ones with a row on M1.2 and M2.2. Individual products fail rule F04. The life policy movements template works out M1.1 and M2.1 for them.
- It counts schemes, not members or lives covered.
- Each scheme has one movement a quarter. A scheme with two, such as one taken on and terminated in the same quarter, can be given as
OTHER. That keeps the totals right but counts neither movement on the template. - The test data has no group annuity schemes, on line 2a, although the products dataset maps a product to it.
- The PA publishes no completion guide or rule list for these sheets. The movement codes and checks follow the template’s columns and formulas, and Quantemplate’s own checks go further.
- It produces the figures, ready to copy into the PA’s template. It doesn’t fill in or submit the template, or check the filing deadline.
- The insurer in the test data, Swartberg Life, is made up. No insurer of that name turned up when we searched in December 2026.
- The build doesn’t set up Auto Run, Auto Export or feeds.
- The agent works through the app in your browser, so changes someone makes in the app whilst it’s working can trip it up.