BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

Is there any function that can do magic converting the string 'Comunicación 1 año' back to its origin 

'Comunicación 1 año'.

 

That does not work but looks promising.

 

data test;
   length instr $50;
   length str1 str2 str3 str4 str5 str6 str7 str8 $ 50;
   instr = "SAS" ||"ae"x || " Comunicación 1 año";
   put instr;
   str1 = kpropdata(instr, 'UESC','utf-8');
   put str1= +2 str1= $hex34.;
   str2 = kpropdata(instr,'TRIM','utf-8');
   put str2= +2 str2= $hex26.;
   str3 = kpropdata(instr,'BLANK', 'utf-8');
   put str3= +2 str3= $hex26.;
   str4 = kpropdata(instr,'?', 'utf-8');
   put str4= +2 str4= $hex26.;
   str5 = kpropdata(instr,'hex', 'utf-8');
   put str5= +2 str5= $hex26.;
   str6 = kpropdata(instr,'TRUNC', 'utf-8');
   put str6= +2 str6= $hex26.;
   str7 = kpropdata(instr,'REMOVE', 'utf-8');
   put str7= +2 str7= $hex26.;
   str8 = kpropdata(instr,'NCR', 'utf-8');
   put str8= +2 str8= $hex26.;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

KCVT().

data test;
  have='Comunicación 1 año';
  expect= 'Comunicación 1 año';
  want = kcvt(have,'utf-8','wlatin1');
  same=expect=want;
run;

Tom_0-1718113131828.png

 

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

KCVT().

data test;
  have='Comunicación 1 año';
  expect= 'Comunicación 1 año';
  want = kcvt(have,'utf-8','wlatin1');
  same=expect=want;
run;

Tom_0-1718113131828.png

 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 530 views
  • 2 likes
  • 2 in conversation