11-30-2015 09:28 AM
When i export a SAS data table to xlsx and i open the document i have the error "file is corrupted". The problem is that in the txt file data is imported to the SAS table exists the illegal caracter NUL.
How can i remove this ascii caracter - ^@ - NUL when i import to SAS?
11-30-2015 09:52 AM
I would remove the NUL characters from all affected character variables or replace all occurrences of NUL by regular blanks if the NULs have been misused as blanks.
data have; length a $5; a=cats('A', '00'x, 'B', '00'x, 'C'); run; /* Either remove NUL ... */ data want; set have; a=compress(a, '00'x); run; /* ... or replace NUL */ data want; set have; a=translate(a, ' ', '00'x); run;
Depending on how you "imported" the .txt file it might also be possible to modify the import step in such a way that the NUL characters don't get into the SAS dataset.
11-30-2015 10:04 AM
I would go back to the source and ask them to fix the issue. It may be null values today, or other issues the next day. I assume you have a data transfer specification in place detailing the structure and content of the data file?