BookmarkSubscribeRSS Feed
Don
Calcite | Level 5 Don
Calcite | Level 5

All,

I have a series of files that are pipe delimited text files. However sas is reading in some special characters at the beginning of the file that show up as "<U+EEFF>".  I assume this means the files are unicode.  I have tried a file name statement with encoding="unicode" and encoding="UTF-8".  It works at some level, but the file now has a ^z at the beginning.  I thought it may be the kind of unicode being used, so I tried all of the different codes listed in the sas help documentation. None work.  I have searched though the discussion, but haven't been able to solve it from what I have found so far. Is it possibly some other version of encoding?  Is there a way to strip all special characters? Any other suggestions?

Thanks in Advance!

Edit: Here is the code I am trying to use:

FILENAME ABC "OLDFILE.TXT" ENCODING="UTF-8"; ******HAVE TRIED MANY DIFFERENT ENCODING TYPES***********;

PROC IMPORT DATAFILE = ABC

     OUT=NEWDATA

     DBMS=DLM REPLACE;

     DELIMITER='|';

     GETNAMES=YES;

     DATAROW=2;

RUN;

Message was edited by: Donald Hale

2 REPLIES 2
ballardw
Super User

Please provide an example of the code you are running, especially the one that came closest to what you want.

If you are reading the files using a wildcard the ^z may be coming from the end of a previous file.

Steelers_In_DC
Barite | Level 11

This is a unix feature, it's been years since I was working with this frequently so I don't remember what it represents...a tab or enter I think.  If you have putty, bluezone or any other unix access you want to vi into the file and copy paste into the vi editor, the Z is case sensitive:

:%s/^Z//g

That should do it.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1890 views
  • 0 likes
  • 3 in conversation