BookmarkSubscribeRSS Feed
rab24
Calcite | Level 5
I am trying to import a dataset that has quite a few special characters. When I used EG 4, it was very helpful in cleaning those special characters and telling me:

/* NOTE: The data that was transferred to the SAS server has been 'cleansed' */
/* prior to the transfer so as to reduce the chance of the SAS server */
/* encountering characters not recognized within the constraints of */
/* the server's current locale. */
/* */
/* This is an automatic process that has been implemented to allow the */
/* data to be transferred to the server for processing. Without */
/* performing this operation the task would fail and the data would */
/* have been unable to be imported. */
/* */
/* The following characters were translated: */
/* Right Single Quotation Mark --> ' 68 times */
/* Left Double Quotation Mark --> " 14 times */
/* Right Double Quotation Mark --> " 14 times */
/* En Dash --> - 20 times */
/* Yen Sign --> Y 15 times */
/* Vulgar Fraction Three Quarters --> 1 times */


Unfortunately, I am trying to run the import with my code instead of in EG and I can't find any calls to this cleansing process. Is there a way I can call this cleanse function in my code before I import rather than use the EG import?
1 REPLY 1
ChrisHemedinger
Community Manager
The "cleansing" process is not part of a SAS program, but happens within EG processing on the client side of things. It works this way because if it tried to transfer the text file to the server for processing first, it's already too late. A text file whose encoding doesn't match the server's session encoding could already cause errors.

If you text file is already on the server and you want to "clean" it, you would have to write a DATA step to read in the text content and emit lines that don't contain the offending characters.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 638 views
  • 0 likes
  • 2 in conversation