Converting A Unicode Text File to An ASCII Text File

We have a large number of text files built in Unicode that we need to
be read by SAS. SAS does not read Unicode text. To convert the Unicode
text to ASCII text we did the following:
A Unicode text file adds an additional blank space to each character.
To remove this blank character, you can use the code below.

The hexidecimal value '00' is a blank character. So remove it using
the SAS statement '00'x. The 'x' tells SAS you are reading

Use RECFM=N to tell SAS that you are reading a stream of data that
will not conform to a typical file structure. SAS will treat the file
as a very long single record.

data _null_;
 infile 'c:\xmlfile.xml' recfm=n;
 file 'c:\ascifile.txt' recfm=n;
 input c $1.;
 if c ne '00'x then put c $1.;
4/25/2008 3:00:56 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 54