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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1661 views
  • 0 likes
  • 3 in conversation