I run this block before I send data to GCP but for some reason, it is adding weird characters to my strings that aren't there before the compress.
array Chars[*] _character_; do i = 1 to dim(Chars); Chars[i] = compress(Chars[i],,'kw'); end; drop i; array Nums[*] _numeric_; do i = 1 to dim(Nums); Nums[i] = round(Nums[i],0.01); end; drop i;
These weird characters, the @ etc. Is there a better way to go about this? Where are these coming from??
Hi, these replies haven't been solutions to this point. Compress isn't removing these: ÀõÖ@ because they're showing up as letters and punctuation. What's troubling to me is that these characters do not exist on the input, even if I convert the string to hex format, they're not there. The compress is creating them.
Controllable Fraud - Other 436F6E74726F6C6C61626C65204672617564202D204F7468657220202020202020202020202020202020202020202020
Are you using DBCS or MBCS. You might try KCOMPRESS to resolve issue.
@ProcWes wrote:
I run this block before I send data to GCP but for some reason, it is adding weird characters to my strings that aren't there before the compress.
array Chars[*] _character_; do i = 1 to dim(Chars); Chars[i] = compress(Chars[i],,'kw'); end; drop i; array Nums[*] _numeric_; do i = 1 to dim(Nums); Nums[i] = round(Nums[i],0.01); end; drop i;
These weird characters, the @ etc. Is there a better way to go about this? Where are these coming from??
Hi, these replies haven't been solutions to this point. Compress isn't removing these: ÀõÖ@ because they're showing up as letters and punctuation. What's troubling to me is that these characters do not exist on the input, even if I convert the string to hex format, they're not there. The compress is creating them.
Controllable Fraud - Other 436F6E74726F6C6C61626C65204672617564202D204F7468657220202020202020202020202020202020202020202020
could you share results of this code with us:
data test;
set <your Data Set> (keep= <one variable that makes problems>);
test1=<one variable that makes problems>;
test2 = compress(test1,,'kw');
a=put(test1,$hex128.);
b=put(test2,$hex128.);
run;
proc print data = test;
run;
Bart
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.
Ready to level-up your skills? Choose your own adventure.