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.
data _null_;
y='1946'; m='מאי'; d='28';
separator='e2808e'x|| '-';
ymd = catx(separator,y,m,d);
put ymd=;
run;
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?
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:
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;
data _null_;
y='1946'; m='מאי'; d='28';
separator='e2808e'x|| '-';
ymd = catx(separator,y,m,d);
put ymd=;
run;
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
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
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!
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.
Ready to level-up your skills? Choose your own adventure.