astore check

Handling Corrupted Model Files in Risk Assessment Pipeline

Scénario de test & Cas d'usage

Business Context

During the transfer of a Credit Risk model from the training environment to the production CAS server, the file was corrupted (truncated). The pipeline must detect this invalid format to prevent the deployment of a broken model.
Data Preparation

Creation of a CAS table with random non-ONNX binary data to simulate a corrupted file.

Copied!
1DATA casuser.onnx_corrupted;
2 LENGTH model_blob varbinary;
3 /* Random garbage data that does not conform to ONNX spec */
4 model_blob = 'FFFFFFFF000000...'x;
5 OUTPUT;
6RUN;

Étapes de réalisation

1
Attempt to validate the corrupted binary object.
Copied!
1PROC CAS;
2 /* We expect this to return a specific validation error in the result */
3 astore.check RESULT=bad_res /
4 onnx={TABLE={caslib='casuser', name='onnx_corrupted'}};
5 PRINT bad_res;
6RUN;

Expected Result


The action executes but returns a validation failure status in the results. The log or output table explicitly states that the binary data is not a valid ONNX format, confirming the system correctly catches bad inputs.