SAM quarterly return, sheet A1 (Investments): validations for custodian holdings

Written from the Prudential Authority's CIC table and definitions and the A1 log file, because the PA publishes no rule list for this sheet. Except for the M rules, each check skips blank values, which the M rules catch.

Mandatory fields
M01  Check that Valuation Date is not empty
M02  Check that Holding ID is not empty
M03  Check that Description is not empty
M04  Check that CIC is not empty
M05  Check that Market Value is not empty
M06  Check that Currency is not empty
M07  Check that Fund Type (Linked, or Non-Linked and Other) is not empty
M08  Check that Holding Type (Direct, or Asset Holding Intermediary) is not empty

Codes
C01  Check that CIC has four characters
C02  Check that the first two characters of CIC are an ISO 3166-1 country code, XL (not listed) or XT (not exchange-tradable)
C03  Check that the third character of CIC is 1 to 9. Derivatives (A to F) are not reported on A1
C04  Check that the fourth character of CIC is a sub-category that exists for its category in the CIC table
C05  Check that cash and deposits (7), mortgages and loans (8) and property (9) use XT
C06  Check that Fund Type is Linked, or Non-Linked and Other
C07  Check that Holding Type is Direct, or Asset Holding Intermediary
C08  Check that Currency is an ISO 4217 currency code

Dates
D01  Check that Valuation Date is the end of a calendar quarter
D02  Check that Valuation Date matches the statement date in the custodian's control totals
D03  Check that Maturity Date is after Valuation Date
D04  Check that Issue Date is before Maturity Date
D05  Check that treasury bonds (CIC ending 15) have a term from issue to maturity of one year or less
D06  Check that commercial paper (CIC ending 23) has a term of less than 270 days
D07  Check that money market instruments (CIC ending 24) have a term of less than one year
D08  Check that short-term deposits (CIC ending 73) have a term of less than one year, and longer deposits (CIC ending 74) a term of more than one year

Values
V01  Check that Market Value is not negative
V02  Check that holdings not in rand have an exchange rate
V03  Check that rand holdings have an exchange rate of 1 or none
V04  Check that Market Value equals Quantity times Price, within R1, where both are given
V05  Check that each Holding ID appears only once in each custodian's file
V06  Check that government-guaranteed parastatal bonds use CIC ending 17, and parastatal bonds without a guarantee use CIC ending 27

Totals
T01  Check that each custodian's total rand value agrees with the statement total in its control totals, within R1

How values are worked out
- Rand value is the market value for rand holdings, and the market value times the exchange rate for other currencies.
- A1 is in R'000. Add up rand values for each A1 row first, then divide by 1,000 and round to the nearest whole number.
- Each holding goes to the A1 row for its CIC category (the last two characters), in the column for its fund type and holding type. cic-to-a1-rows.csv lists the rows.

Empty row validator: if Holding ID, Description and Market Value are all empty, the row is considered empty and ignored.
