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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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