![]() | ![]() | ![]() | ![]() | ![]() |
If you use a program similar to the following to read a files object that contains a text content type (for example, text/plain or text/html) in a LATIN1 SAS session encoding, and you read the files object back in a fixed record format, the text file is not read correctly:
proc options option=encoding;
run;
filename epCode temp;
filename srcEp filesrvc "/files/files/e4bdb952-0c6c-4821-a716-3cb52baa6373";
data _null_;
infile srcEp length=len recfm=f _infile_=tmp;
file epCode recfm=n;
input;
put tmp $varying32767. len;
run;
If you set the SAS session encoding to LATIN1, you will receive an incorrect number of records and an incorrect file Encoding= value. You could also receive an error that indicates a transcoding problem in the SAS log. The corresponding SAS log looks similar to the following:
If the filename filesrvc worked correctly, it should read in 18 records (4517/256=17.64), and the Encoding= value should be ISO_8859-1. Instead, it reads only in 5 records and the Encoding= value is UTF-8.
Note that you can use the following file to check the contents: /opt/sas/viya/config/var/tmp/compsrv/default/0ff60388-dfe0-4fc6-830e-39f31d8c15d2/SAS_work649D0001103B_sasserver.demo.sas.com/#LN00116. However, that file is not the same as the following file: /files/files/e4bdb952-0c6c-4821-a716-3cb52baa6373
To work around this issue, change the SAS session encoding to UTF-8.
Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.
Product Family | Product | System | Product Release | SAS Release | ||
Reported | Fixed* | Reported | Fixed* | |||
SAS System | SAS Viya 3.x | Microsoft® Windows® for x64 | 3.5 | Viya 3.5 | ||
Linux for x64 | 3.5 | Viya 3.5 |