BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NN
Quartz | Level 8 NN
Quartz | Level 8

If on Utf, i think you can try using "kcompress" instead of compress function and "ktranslate" instead of translate.

that should work.

Shmuel
Garnet | Level 18

 


@NN wrote:

If on Utf, i think you can try using "kcompress" instead of compress function and "ktranslate" instead of translate.

that should work.


You are right, I replaced the translate & compress to k-functions but at the same time

I had to enlarge the length of the string and finally got the correct results.

Shmuel
Garnet | Level 18

@FreelanceReinh I'm curious to know if you see the same symbols I see.

The next picture is the screenshot of my last post - what graphic is shown for 'EF'x and 'FF'x -

those tow characters which hold 2 bytes in your environment hold 4 bytes in UTF-8 environment:

EF-FF.JPG

FreelanceReinh
Jade | Level 19

@Shmuel wrote:

@FreelanceReinh I'm curious to know if you see the same symbols I see.


@Shmuel: I see the same symbols, but with my Wlatin1 session encoding the PUTLOG statement, of course, writes x=FEFF.

 

My first idea for these temporary replacement characters were non-printable characters like '02'x (especially to avoid ASCII codes >127), but these are less convenient to use in PRXCHANGE and also caused other difficulties. That's why I resorted to 'FE'x and 'FF'x (but there may be better choices, also depending on the language of the text and expected characters in variable STRING).

Shmuel
Garnet | Level 18

May I summit this chain from my point of view:

1) While test was moved between different encoding environments (in this case from Latin1 to UTF-8)

     the hexadecimal representation of characters was changed in order to keep their visual appearance.

2) The target of this post was an interesting challenge of programming for me and at the same time

    a good experience to understand Perl expression (Regex) used with prxchange function and the

    usage of k functions (ktranslate, kcompress) - both new for me.

 

So thanks a lot to @FreelanceReinh and to @NN for your responses.

I appreciate it very much. Have a nice day.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 19 replies
  • 6688 views
  • 7 likes
  • 7 in conversation