@citizben
"message_json" is a JSON type variable containing longer than 32767 characters
Redshift doesn't document a data type JSON. Is it a VARCHAR? https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html
SAS 9.4 type tables are limited to character variables of max 32767 bytes. SAS Viya CAS tables allow for longer character variables. Which SAS version are you using? Please let us know the result when running %put &=sysvlong; Same as below from my environment.
69 %put &=sysvlong;
SYSVLONG=9.04.01M7P080620
With SAS9.4 you will likely need to split your variable into chunks of 32767 characters (=creating multiple variables) that you then put together on the SAS side when writing to a text file.
Should you have Viya CAS then you should be able to load the long variable from Redshift directly into a CAS Varchar and then write to a text file directly out of CAS.
Also SAS9.4 M5 and later got a Varchar data type that can store more than 32767 characters and that's available both within DS2 and the SAS data step BUT you can't write it to a SAS table and more importantly I believe the SAS/Access engine won't allow you to retrieve more than a 32767 character string from a database so you'll never get the full string into SAS even though you could directly write it out to a text file without the need to store it in a SAS table. https://support.sas.com/resources/papers/proceedings18/2690-2018.pdf
... View more