Hindi to English

Reply
Occasional Contributor
Posts: 13

Hindi to English

I have data in excel file in Base64 format. Typical row is:

 

REF_NOACC_REF_NOFIN_YEARACCUSED_NAME
303325201620174KSm4KWA4KSqIOCkmuCkguCkpg==

 

I am trying to read this in SAS. Accused_Name is in Base64x format. If I decode it using generic websites on Google it returns "दीप चंद" which is Hindi text. I want the final result in English which should be "Deep Chand". How can I achieve this ? I am using below line of code to deocde base64 but it doesn't give even दीप चंद. 

 

%let name ='4KSm4KWA4KSqIOCkmuCkguCkpg==';
%let name_decode = (%sysfunc(inputc(%scan(&name,1,':')===,$base64x12.)));
%put &=name_decode;

SAS Employee
Posts: 111

Re: Hindi to English

[ Edited ]

@avinashaecwb,

 

I would use something like that. Basically, you need to know the length of Base64 encoded string. So in your case, you can use $base64x28., instead of $base64x32767. 32767 is the max length of string when using Base64.

 

%let name ='4KSm4KWA4KSqIOCkmuCkguCkpg==';
%let name_decode = (%trim(%sysfunc(inputc(%scan(&name,1,':')===,$base64x32767.))));
%put &=name_decode;

 

Occasional Contributor
Posts: 13

Re: Hindi to English

Hi @alexal - The output given by base64decode.org is दीप चंद . But if I execute the code in SAS, it doesn't give this result. I am assuming that is because दीप चंद is in Devnagri (Hindi) script. How can I force my SAS to decode the output in Devnagri script ? Would NLS help ? Finally, I need English output. So, first I need to Decode Base64 to Devnagri and then back to English.

Ask a Question
Discussion stats
  • 2 replies
  • 114 views
  • 0 likes
  • 2 in conversation