BookmarkSubscribeRSS Feed
Vahe_Mar
Obsidian | Level 7

 HElP me to drop    "–  from drom dataset

I am using SAS 9.4, data came from 9.4UTF 

Thanks,
Vahe
6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20

You have to provide more information than that to be sure to get a proper answer. 

 

I can only guess that you have some character variable for which you want to get rid of the characters â and €?

 

If so use Compress Function like this

 

data test;
	charvar="helloâthere€you";
	newVar=compress(charvar, 'â€');
run;

 

 

Vahe_Mar
Obsidian | Level 7

I tried this way but doesnt work

 

Thanks,
Vahe
PeterClemmensen
Tourmaline | Level 20

Then you have to provide more information:

 

- What does your data look like?

- What does your code look like?

- What Errors appear in the log?

Vahe_Mar
Obsidian | Level 7

data look likes your example

no error and warning in code part , thats pinnacle issue

 

Thanks,
Vahe
Kurt_Bremser
Super User

@Vahe_Mar wrote:

I tried this way but doesnt work

 


???

data test;
	charvar="helloâthere€you";
	newVar=compress(charvar, 'â€');
run;

proc print data=test noobs;
run;

Result:

    charvar           newVar

helloâthere€you    hellothereyou

Works.

 

If it "does not work" for you, post your code (if you use a dataset, post that dataset in a data step, use the macro from https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...), post the log, and post the result (just as I did). Follow the advice in https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce to post code; use the {i} icon to post logs or list data.

Vahe_Mar
Obsidian | Level 7

ASCII or UTF

Thanks,
Vahe

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 848 views
  • 0 likes
  • 3 in conversation