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

I have read Eyal Gonen's article about converting sas date into Hebrew date

and encountered an issue forcing order of text.

I would like to get order as yyyy-mmm-dd but all combinations result into one of two:

at left are numbers and on right the month name:

data _null_; 
  y='1946';  m='מאי'; d='28'; 
  ymd = catx('-',y,m,d); 
  ydm = catx('-',y,d,m); 
   
  myd = catx('-',m,y,d); 
  mdy = catx('-',m,d,y); 
   
  dmy = catx('-',d,m,y); 
  dym = catx('-',d,y,m); 
   
  put ymd= ydm= myd= mdy= dmy= dym=; 
run;

and the result is:

ymd=1946-מאי-28 ydm=1946-28-מאי myd=מאי-1946-28 mdy=מאי-28-1946 dmy=28-מאי-1946 dym=28-1946-מאי

I'm using SAS UE with Windows-10.

1 ACCEPTED SOLUTION

Accepted Solutions
arielbud
SAS Employee

data _null_;
y='1946'; m='מאי'; d='28';
separator='e2808e'x|| '-';
ymd = catx(separator,y,m,d);

put ymd=;
run;

View solution in original post

6 REPLIES 6
Shmuel
Garnet | Level 18

I know there were formats to display in logical or visual order of Hebrew text.
Is it available under SAS UE? and what are the exact format names?

EyalGonen
Lapis Lazuli | Level 10

Hi Shmuel,

 

I have not tried this (yet) with a UTF8 encoding SAS session but with a standard Hebrew encoding here is what you can do to make this work. 

The problem you see is only a visual thing. SAS stores the data correctly but the display is wrong. The FD hex forces Windows to form a logical separation of the sub-texts.

I think you need to post these kind of questions in the *new* SAS Users in Israel group as this is Hebrew specific.

 

data _null_;
y='1946'; m='מאי'; d='28';
ymd = catt(y,'-','FD'x,m,'-','FD'x,d);

put ymd=;
run;

 

Here is the log:

 

EyalGonen_0-1589282589731.png

 

arielbud
SAS Employee

Because it SAS University Edition and uses UTF , please try instead DF the e2808e

 

data _null_;
y='1946'; m='מאי'; d='28';
ymd = catt(y,'-','e2808e'x,m,'-','e2808e'x,d);

put ymd=;
run;

arielbud
SAS Employee

data _null_;
y='1946'; m='מאי'; d='28';
separator='e2808e'x|| '-';
ymd = catx(separator,y,m,d);

put ymd=;
run;

Shmuel
Garnet | Level 18

I have tried the 'FD'x separator as

   

         ymd = catt(y,'-','FD'x,m,'FD'x,'-',d);
         put ymd=;

and the result is

     ymd=1946-�מאי�-28

EyalGonen
Lapis Lazuli | Level 10

Hi Shmuel,

 

I wrote in my reply that using the 'FD'x byte works with the Hebrew encoding and not in UTF8 encoding.

 

@arielbud found the equivalent of the 'FD'x byte in Unicode and posted it later.

If you use UTF8 use Ariel's code. If you use Hebrew encoding use my code.

 

I hope this clarifies this issue for you.

 

Eyal

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
  • 6 replies
  • 2039 views
  • 1 like
  • 3 in conversation