SAM quarterly return: A1 investments

South Africa

Codes three custodians’ holdings with the Prudential Authority’s CIC table, checks them, and totals them into sheet A1 of the SAM quarterly return in R’000.

From Prudential Authority: SAM quarterly solo return, sheet A1 (Investments), and the CIC table

SAM quarterly return: A1 investments
Rules, the CIC-to-A1 table, custodian test files, a build skill and build scripts. Zip, 55 KB.
Download the template

See it in Quantemplate

The pipeline

The SAM A1 pipeline in Quantemplate: stages 1 to 13 of 16 listed, from Prepare Karoo Custody holdings to Validate holdings, with the three custodians’ test files uploaded.

The flow

The pipeline’s Flow tab: the CIC-to-A1 rows and custodian control totals datasets feed into the SAM A1 pipeline.

The checked output

The A1 Investments table: 21 rows, one for each A1 line that holds investments, starting with Central Government Bonds, with its Excel row on sheet A1, rand amounts and R’000 totals for linked and non-linked holdings.

What it checks

31 rules 31 Fail

A rule set to Fail marks its rows as failed, and any failure blocks Auto Export if you set it up. Validation never removes a row. Every rule is listed in plain English in a1-validations.txt in the download.

How the pipeline works

  1. Stages 1–3 Intake Turn each custodian’s layout into common columns, working out missing CIC codes
  2. Stages 4–5 Union and code Stack the holdings, then add each one’s CIC category, rand value and A1 column
  3. Stages 6–7 Reference data The CIC-to-A1 table and the custodians’ control totals
  4. Stages 8–9 Totals Holdings per ID and totals by custodian
  5. Stages 10–13 Joins and Validate Bring the totals onto every holding and run 30 rules
  6. Stages 14–15 Statement check Compare each custodian’s total with its statement
  7. Stage 16 A1 Investments One row per A1 line in R’000, ready to copy into sheet A1

What’s in the download

The PA’s quarterly template and CIC table aren’t included. Download the current versions from the PA’s insurer returns page.

Build it

  1. Unzip the download and copy the folder in skills into ~/.claude/skills/. The Quantemplate skills help too, if you have them.
  2. With Claude in Chrome signed in to Quantemplate, ask Claude Code:
    Build the SAM A1 investments pipeline from the sam-a1-investments folder. Test it with the broken files and the clean files and compare the results with the expected ones.
  3. Claude creates the two reference datasets, uploads the custodian files, builds the 16 stages and checks both test sets. 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 the agent offers to click through the screens instead, which takes much longer. Review what the agent builds before you rely on it.

Using real holdings

Contact the Quantemplate support team, or use your AI agent, to build custom logic for your use case.

Limits