Attempting to save large CAS tables as CSV files in a S3 caslib results in "ERROR: Critical TK KERNEL error"


In SAS Viya 3.5, when you attempt to save large CAS tables as CSV files in a S3 caslib, the following error is returned: 

ERROR: Critical TK KERNEL error
ERROR: The action stopped due to errors.

This error is usually encountered with files over 30GB, but there is not an exact limit where the error occurs. This error is encountered only when saving the data a CSV file, not as a .parquet file.

Workaround

To work around the issue, save the data as a .parquet file instead of .csv file.