BookmarkSubscribeRSS Feed
EyalGonen
Lapis Lazuli | Level 10

שלום לכולם,

 

לעיתים עולות שאלות לגבי הפקת דוחות בפורמט PDF מימין למשאל על ידי שימוש ב ODS.

 

לפני שנדון באפשרויות להפקת הדוח מימין לשמאל יש לציין שעל מנת להציג את העברית באופן תקין (לא הפוך) יש להפעיל את האופציות הבאות ב SAS. ההנחה היא שהעברית היא עברית ויזואלית כמו זו שכותבים בכל אפליקצייה על Windows כגון אקסל, וורד וכד'.

 

 

 

/* add these options to the SASV9.CFG file */ 
-encoding=hebrew    /* SAS on Linux this is usually the default   */
-encoding=whebrew   /* SAS on Windows this is usually the default */

/* Set inside the SAS code */
options locale=en_US; 

 

 

 

לגבי שינוי תצוגת הדוח מימין לשמאל - לצערי האפשרות הזו אינה קיימת באופן ישיר אך כן ישנם שני מעקפים.

 

מעקף ראשון הוא לייצר דוח בפורמט RTF מימין לשמאל (ראו בלוג זה) ואז פשוט לבצע Save As לקובץ בפורמט PDF. אם רוצים אפילו אפשר לעשות אוטומציה לתהליך זה על שרתי Windows. ראו קוד לדוגמה למטה.

 

מעקף שני הוא להשתמש ב SAS Visual Analytics לצורך הצגת הדוחות. כלי זה תומך בתצוגה מימין לשמאל וגם מאפשר שמירה של הדוחות בפורמט PDF מימין לשמאל. זהו כמובן פתרון אך ורק למי שיש לו ברישוי את המוצר הזה.

 

 

/* The DDE option is available only for SAS on Windows */
options noxsync noxwait xmin;
filename sas2word dde 'winword|system';
data _null_;
 length fid rc start stop time 8;
 fid=fopen('sas2word','s');
 if (fid le 0) then do;
 rc=system('start winword');
 start=datetime();
 stop=start+10;
 do while (fid le 0);
 fid=fopen('sas2word','s');
 time=datetime();
 if (time ge stop) then fid=1;
 end;
 end;
 rc=fclose(fid);
run;

data _null_;
 file sas2word;
 put '[FileOpen.Name = "c:\temp\right_to_left.rtf"]'; /* this is the RTL'd RTF file */
 put '[ChDefaultDir "c:\temp\",0]';
 put '[FileSaveAs.Name="right_to_left",.Format=17]'; /* 17 = PDF format */
 put '[FileClose 2]';
 put '[AppClose]'; 
run;

filename sas2word;

 

 

יש לכם הערות/שאלות בנושא - אשמח אם תגיבו!

אייל 

1 REPLY 1
Alex_Fedorov
SAS Employee

תודה רבה אייל! 👍👏

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Discussion stats
  • 1 reply
  • 596 views
  • 3 likes
  • 2 in conversation