<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sentences  from right to left in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935352#M367750</link>
    <description>&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;I have some questions related to your reply please:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question1&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I run your code and receive an error-ERROR: Template 'Styles.Mystyle' was unable to write to template store!&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question2&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I want to add report to email body (Honda cars report) and&amp;nbsp; also attach XLSX file with report related to class data.&lt;/P&gt;
&lt;P&gt;In my code I export the class reports into XLSX file and this is the file that I want to attach.&lt;/P&gt;
&lt;P&gt;This file is located in&amp;nbsp;"/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Class_Report.xlsx&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/P&gt;
&lt;P&gt;In your code I don't see that you used attachment statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the full Log to see the error&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1                                                          The SAS System                             18:42 Wednesday, July 10, 2024

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         FILENAME EGSR TEMP;
15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16             STYLE=HTMLBlue
17             STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")
18             NOGTITLE
19             NOGFOOTNOTE
20             GPATH=&amp;amp;sasworklocation
21             ENCODING=UTF8
22             options(rolap="on")
23         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         
25         GOPTIONS ACCESSIBLE;
26         
27         ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.printer;
NOTE: Writing HTML Body file: /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html
28         ods escapechar='^';
29         
30         proc template;
31         define style styles.mystyle;
32         parent=styles.printer;
33         style table / just=l ;
34         style footer / just=r ;
35         end;
ERROR: Template 'Styles.Mystyle' was unable to write to template store!
36         run;
NOTE: PROCEDURE TEMPLATE used (Total process time):
      real time           0.02 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              107.34k
      OS Memory           25248.00k
      Timestamp           07/10/2024 06:42:23 PM
      Step Count                        2  Switch Count  2
      Page Faults                       0
      Page Reclaims                     101
      Page Swaps                        0
      Voluntary Context Switches        10
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      
WARNING: Errors were produced.
NOTE: The SAS System stopped processing this step because of errors.
37         
2                                                          The SAS System                             18:42 Wednesday, July 10, 2024

38         ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.mystyle;
NOTE: Writing HTML Body file: /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html
39         filename temp email
40         from = "Ron.Einstein@BankLeumi.co.il"
41         to=("Ron.Einstein@BankLeumi.co.il")
42         subject="דוח רכבי הונדה"
43         type="text/html"
44         encoding='utf-8' ;
45         /****Report in Body email+Footnotes in Body email***/
46         footnote1  justify=right  'שלום רב,';
47         footnote2  justify=right  'להלן דוח רכבי הונדה';


48         proc report data=sashelp.cars contents="Honda Cars";
49         where Make="Honda";
50         column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency"
51         mpg_city   mpg_highway);
52         run;

NOTE: Multiple concurrent threads will be used to summarize data.
NOTE: There were 17 observations read from the data set SASHELP.CARS.
      WHERE Make='Honda';
NOTE: PROCEDURE REPORT used (Total process time):
      real time           0.14 seconds
      user cpu time       0.02 seconds
      system cpu time     0.01 seconds
      memory              8507.09k
      OS Memory           33972.00k
      Timestamp           07/10/2024 06:42:23 PM
      Step Count                        3  Switch Count  1
      Page Faults                       0
      Page Reclaims                     2635
      Page Swaps                        0
      Voluntary Context Switches        42
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      

53         ods html close
54         
55         GOPTIONS NOACCESSIBLE;
           ________ ____________
           1        79
                    76
WARNING 1-322: Assuming the symbol OPTIONS was misspelled as GOPTIONS.
ERROR 79-322: Expecting a (.
ERROR 76-322: Syntax error, statement will be ignored.
56         %LET _CLIENTTASKLABEL=;
57         %LET _CLIENTPROCESSFLOWNAME=;
58         %LET _CLIENTPROJECTPATH=;
59         %LET _CLIENTPROJECTPATHHOST=;
60         %LET _CLIENTPROJECTNAME=;
61         %LET _SASPROGRAMFILE=;
62         %LET _SASPROGRAMFILEHOST=;
63         
64         ;*';*";*/;quit;run;
65         ODS _ALL_ CLOSE;
3                                                          The SAS System                             18:42 Wednesday, July 10, 2024

66         
67         
68         QUIT; RUN;
69         
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 15:49:51 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-07-10T15:49:51Z</dc:date>
    <item>
      <title>sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935101#M367657</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to send an email via sas with following elements:&lt;/P&gt;
&lt;P&gt;1-Attach report (based on sashelp.class data)&lt;/P&gt;
&lt;P&gt;2-Report on email body (based on sashelp.cars)&lt;/P&gt;
&lt;P&gt;3-Few sentences in email body. (It was written in code as footnotes to proc report)&lt;/P&gt;
&lt;P&gt;My question-&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;sentences are written in Hebrew language .&lt;/P&gt;
&lt;P&gt;Hebrew is written from right to left but the sentences appears in the email body from left to right.&lt;/P&gt;
&lt;P&gt;What is the way that the Hebrew&amp;nbsp;sentences appears from right to left?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" ;
ods excel options (sheet_name='F');
proc report data=sashelp.class;
where sex='F';
column name age height weight;
define name / group;
run;
ods excel options (sheet_name='M');
proc report data=sashelp.class;
where sex='M';
column name age height weight;
define name / group;
run;
ods excel close;

title;
footnote;
filename temp email
from = "Ron.Einstein@BankLeumi.co.il"
TO=("Ron.Einstein@BankLeumi.co.il")
subject="דוח רכבי הונדה"
type="text/html"
encoding='utf-8' 
attach=("/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" 
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
ODS html body=temp  ;
FOOTNOTE1  justify=right  'שלום רב,';
FOOTNOTE2  justify=right  'להלן דוח רכבי הונדה';
proc report data=sashelp.cars contents="Honda Cars";
where Make="Honda";
column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" mpg_city   mpg_highway);  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 07:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935101#M367657</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-09T07:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935194#M367704</link>
      <description>&lt;P&gt;Hello, if I understand correctly you are asking to read the footnotes in SAS from right to left since they are in Hebrew.&lt;/P&gt;
&lt;P&gt;This is possible by combining a few different functions in a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;First&lt;/STRONG&gt;, we will define our footnote1 and footnote 2 as variables inside a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   foot1 = 'שלום רב,' ;
   foot2 = 'להלן דוח רכבי הונדה' ;
run;&lt;/PRE&gt;
&lt;P&gt;The 'data _null_' step is a data step that does not create an output data set, and does not require an existing data set to read in. Think of it as a data step that just executes code and processes data without actually outputting a new data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;next step&lt;/STRONG&gt; is to use the scan function to extract each word from foot1 and foot2.&lt;/P&gt;
&lt;P&gt;Here I create new variables, for each word of foot1 and foot2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember foot1 has 2 words (separated by 1 space) and foot2 has 4 words (separated by three spaces) so we need to scan foot1 twice and scan foot2 four times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   foot1 = 'שלום רב,' ;
   foot2 = 'להלן דוח רכבי הונדה' ;

   foot1_1 = scan(foot1,1,' ');
   foot1_2 = scan(foot1,2,' ');

   foot2_1 = scan(foot2,1,' ');
   foot2_2 = scan(foot2,2,' ');
   foot2_3 = scan(foot2,3,' ');
   foot2_4 = scan(foot2,4,' ');

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Now&lt;/STRONG&gt; to put this all together but in backwards order (right to left), use the 'catx' function to concatenate, or combine, each word starting from the last to the first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   foot1 = 'שלום רב,' ;
   foot2 = 'להלן דוח רכבי הונדה' ;

   foot1_1 = scan(foot1,1,' ');
   foot1_2 = scan(foot1,2,' ');

   foot2_1 = scan(foot2,1,' ');
   foot2_2 = scan(foot2,2,' ');
   foot2_3 = scan(foot2,3,' ');
   foot2_4 = scan(foot2,4,' ');

   foot1_reverse = catx(' ',foot1_2,foot1_1);
   foot2_reverse = catx(' ',foot2_4,foot2_3,foot2_2,foot2_1);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used the catx function here instead of the cat function so we could add a space (' ') between each word when they are combined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&lt;STRONG&gt; last part&lt;/STRONG&gt; of the data step is to put the values of foot1_reverse and foot2_reverse into 'macro variables' that can be passed to the footnote statement in ODS HTML.&lt;/P&gt;
&lt;P&gt;This is done by using the 'call symputx' function, and needs to be done to pass the result of foot1_reverse and foot2_reverse to the HTML footnotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   foot1 = 'שלום רב,' ;
   foot2 = 'להלן דוח רכבי הונדה' ;

   foot1_1 = scan(foot1,1,' ');
   foot1_2 = scan(foot1,2,' ');

   foot2_1 = scan(foot2,1,' ');
   foot2_2 = scan(foot2,2,' ');
   foot2_3 = scan(foot2,3,' ');
   foot2_4 = scan(foot2,4,' ');

   foot1_reverse = catx(' ',foot1_2,foot1_1);
   foot2_reverse = catx(' ',foot2_4,foot2_3,foot2_2,foot2_1);

   call symputx('foot1_reverse', foot1_reverse);
   call symputx('foot2_reverse', foot2_reverse);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Finally&lt;/STRONG&gt;, you can apply the reversed strings (foot1_reverse and foot2_reverse) in the ODS HTML footnotes. Because we used the 'call symputx' function to store foot1_reverse and foot2_reverse as macro variables (so they can be used outside of the _null_ data step), we need to reference them in the footnote statements with '&amp;amp;'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html body=temp ;

   FOOTNOTE1  justify=right  "&amp;amp;foot1_reverse";
   FOOTNOTE2  justify=right "&amp;amp;foot2_reverse";

   proc report data=sashelp.cars contents="Honda Cars";
   where Make="Honda";
   column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" mpg_city   
   mpg_highway);  

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 17:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935194#M367704</guid>
      <dc:creator>procphysics</dc:creator>
      <dc:date>2024-07-09T17:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935263#M367732</link>
      <description>&lt;P&gt;Thank you so much,&lt;/P&gt;
&lt;P&gt;However I think there was misunderstanding.&lt;/P&gt;
&lt;P&gt;What you did is that you&amp;nbsp; changed the order of the words in each footnote.&lt;/P&gt;
&lt;P&gt;I only asked to move the footnote from left side to right side.&lt;/P&gt;
&lt;P&gt;In Hebrew we read from right to left so it is better to locate the text in right side.&lt;/P&gt;
&lt;P&gt;Please look at this email , can you see that the text is located in left side and not right side?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1720586825291.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98270i2D0855B91EB6EFC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1720586825291.png" alt="Ronein_0-1720586825291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 04:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935263#M367732</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-10T04:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935334#M367745</link>
      <description>&lt;P&gt;Ah I see. You want to place the footnotes on the right side of the page instead of the left.&lt;/P&gt;
&lt;P&gt;This is not directly supported by default SAS functionality. However you can manually adjust the position of the footnotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;/P&gt;
&lt;P&gt;ODS HTML sends the output to an HTML file called 'Class_Report.html'.&lt;/P&gt;
&lt;P&gt;ODS escapechar allows you to apply style changes in the footnotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html'&amp;nbsp;style=styles.printer;&lt;BR /&gt;ods&amp;nbsp;escapechar='^';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.&lt;/P&gt;
&lt;P&gt;PROC TEMPLATE lets you define a custom style template called 'styles.mystyle' that is inherited from 'style.printer'. I've linked more info on that &lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/053-31.pdf" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here we set the table to be left-justified (just=l), and the footnotes to be right-justified (just=r).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define style styles.mystyle;
   parent=styles.printer;
   style table / just=l ;
   style footer / just=r ;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3.&lt;/P&gt;
&lt;P&gt;ODS HTML applies the custom style 'styles.mystyle' to the output in HTML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We set a right-aligned footnote1 and footnote2 using 'justify=right'.&lt;/P&gt;
&lt;P&gt;Then insert your code and data table for the PROC REPORT part.&lt;/P&gt;
&lt;P&gt;Finally close the ODS HTML destination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.mystyle;
   filename temp email
   from = "Ron.Einstein@BankLeumi.co.il"
   to=("Ron.Einstein@BankLeumi.co.il")
   subject="דוח רכבי הונדה"
   type="text/html"
   encoding='utf-8' ;&lt;BR /&gt;   footnote1  justify=right  'שלום רב,';
   footnote2  justify=right  'להלן דוח רכבי הונדה';&lt;BR /&gt;&lt;BR /&gt; proc report data=sashelp.cars contents="Honda Cars";
      where Make="Honda";
      column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" 
      mpg_city   mpg_highway);  
 run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The code all together:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.printer;
ods escapechar='^';

proc template;
   define style styles.mystyle;
   parent=styles.printer;
   style table / just=l ;
   style footer / just=r ;
   end;
run;

ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.mystyle;
   filename temp email
   from = "Ron.Einstein@BankLeumi.co.il"
   to=("Ron.Einstein@BankLeumi.co.il")
   subject="דוח רכבי הונדה"
   type="text/html"
   encoding='utf-8' ;

   footnote1  justify=right  'שלום רב,';
   footnote2  justify=right  'להלן דוח רכבי הונדה';

   proc report data=sashelp.cars contents="Honda Cars";
      where Make="Honda";
      column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" 
      mpg_city   mpg_highway);  
   run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The HTML file will now have footnote on the bottom right of the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 14:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935334#M367745</guid>
      <dc:creator>procphysics</dc:creator>
      <dc:date>2024-07-10T14:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935352#M367750</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;I have some questions related to your reply please:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question1&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I run your code and receive an error-ERROR: Template 'Styles.Mystyle' was unable to write to template store!&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question2&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I want to add report to email body (Honda cars report) and&amp;nbsp; also attach XLSX file with report related to class data.&lt;/P&gt;
&lt;P&gt;In my code I export the class reports into XLSX file and this is the file that I want to attach.&lt;/P&gt;
&lt;P&gt;This file is located in&amp;nbsp;"/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Class_Report.xlsx&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/P&gt;
&lt;P&gt;In your code I don't see that you used attachment statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the full Log to see the error&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1                                                          The SAS System                             18:42 Wednesday, July 10, 2024

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         FILENAME EGSR TEMP;
15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16             STYLE=HTMLBlue
17             STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")
18             NOGTITLE
19             NOGFOOTNOTE
20             GPATH=&amp;amp;sasworklocation
21             ENCODING=UTF8
22             options(rolap="on")
23         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         
25         GOPTIONS ACCESSIBLE;
26         
27         ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.printer;
NOTE: Writing HTML Body file: /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html
28         ods escapechar='^';
29         
30         proc template;
31         define style styles.mystyle;
32         parent=styles.printer;
33         style table / just=l ;
34         style footer / just=r ;
35         end;
ERROR: Template 'Styles.Mystyle' was unable to write to template store!
36         run;
NOTE: PROCEDURE TEMPLATE used (Total process time):
      real time           0.02 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              107.34k
      OS Memory           25248.00k
      Timestamp           07/10/2024 06:42:23 PM
      Step Count                        2  Switch Count  2
      Page Faults                       0
      Page Reclaims                     101
      Page Swaps                        0
      Voluntary Context Switches        10
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      
WARNING: Errors were produced.
NOTE: The SAS System stopped processing this step because of errors.
37         
2                                                          The SAS System                             18:42 Wednesday, July 10, 2024

38         ods html file='/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html' style=styles.mystyle;
NOTE: Writing HTML Body file: /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.html
39         filename temp email
40         from = "Ron.Einstein@BankLeumi.co.il"
41         to=("Ron.Einstein@BankLeumi.co.il")
42         subject="דוח רכבי הונדה"
43         type="text/html"
44         encoding='utf-8' ;
45         /****Report in Body email+Footnotes in Body email***/
46         footnote1  justify=right  'שלום רב,';
47         footnote2  justify=right  'להלן דוח רכבי הונדה';


48         proc report data=sashelp.cars contents="Honda Cars";
49         where Make="Honda";
50         column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency"
51         mpg_city   mpg_highway);
52         run;

NOTE: Multiple concurrent threads will be used to summarize data.
NOTE: There were 17 observations read from the data set SASHELP.CARS.
      WHERE Make='Honda';
NOTE: PROCEDURE REPORT used (Total process time):
      real time           0.14 seconds
      user cpu time       0.02 seconds
      system cpu time     0.01 seconds
      memory              8507.09k
      OS Memory           33972.00k
      Timestamp           07/10/2024 06:42:23 PM
      Step Count                        3  Switch Count  1
      Page Faults                       0
      Page Reclaims                     2635
      Page Swaps                        0
      Voluntary Context Switches        42
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      

53         ods html close
54         
55         GOPTIONS NOACCESSIBLE;
           ________ ____________
           1        79
                    76
WARNING 1-322: Assuming the symbol OPTIONS was misspelled as GOPTIONS.
ERROR 79-322: Expecting a (.
ERROR 76-322: Syntax error, statement will be ignored.
56         %LET _CLIENTTASKLABEL=;
57         %LET _CLIENTPROCESSFLOWNAME=;
58         %LET _CLIENTPROJECTPATH=;
59         %LET _CLIENTPROJECTPATHHOST=;
60         %LET _CLIENTPROJECTNAME=;
61         %LET _SASPROGRAMFILE=;
62         %LET _SASPROGRAMFILEHOST=;
63         
64         ;*';*";*/;quit;run;
65         ODS _ALL_ CLOSE;
3                                                          The SAS System                             18:42 Wednesday, July 10, 2024

66         
67         
68         QUIT; RUN;
69         
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 15:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935352#M367750</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-10T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935359#M367754</link>
      <description>&lt;P&gt;Great questions. The first question can be addressed &lt;A href="https://support.sas.com/techsup/notes/v8/4/739.html" target="_self"&gt;here&lt;/A&gt; and &lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-TEMPLATE-Error-Message-Unable-to-Write-to-Template-Store/td-p/7969" target="_self"&gt;here&lt;/A&gt;. Just add&amp;nbsp;&lt;CODE class=" language-sas"&gt;ods path (prepend) work.templat(update);&lt;/CODE&gt; before proc template.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the second question, you will reference it within your ODS HTML statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All together your code should now be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file = "/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" ;

ods excel options (sheet_name='F');

proc report data=sashelp.class;
   where sex='F';
   column name age height weight;
   define name / group;
run;

ods excel options (sheet_name='M');

proc report data=sashelp.class;
   where sex='M';
   column name age height weight;
   define name / group;
run;

ods excel close;

ods path (prepend) work.templat(update);

ods escapechar='^';

proc template;
   define style styles.mystyle;
   parent=styles.printer;
   style table / just=l ;
   style footer / just=r ;
   end;
run;

filename temp email

   from = "Ron.Einstein@BankLeumi.co.il"
   to=("Ron.Einstein@BankLeumi.co.il")
   subject="דוח רכבי הונדה"
   type="text/html"
   encoding='utf-8' 
   attach = 
   ("/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" 
   content_type="application/vnd.openxmlformats- 
   officedocument.spreadsheetml.sheet");

ods html body=temp style=styles.mystyle;
   FOOTNOTE1  justify=right  "שלום רב,";
   FOOTNOTE2  justify=right   "להלן דוח רכבי הונדה";

proc report data=sashelp.cars contents="Honda Cars";
   where Make="Honda";
   column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" mpg_city   
   mpg_highway);  
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 16:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935359#M367754</guid>
      <dc:creator>procphysics</dc:creator>
      <dc:date>2024-07-10T16:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935395#M367770</link>
      <description>&lt;P&gt;Thanks a lot,&lt;/P&gt;
&lt;P&gt;I run your code but still footnotes are written in left side and not in right side as requested for my language.&lt;/P&gt;
&lt;P&gt;By the way, it was also better that the table also located in right side and order of columns is as you see&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1720640091795.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98304i476DAAD353A479B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1720640091795.png" alt="Ronein_0-1720640091795.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code I run (It is exactly your code)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*******Export Reports to XLSX file****/
/*******Export Reports to XLSX file****/
/*******Export Reports to XLSX file****/
ods excel file = "/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" ;
ods excel options (sheet_name='F');
proc report data=sashelp.class;
where sex='F';
column name age height weight;
define name / group;
run;
ods excel options (sheet_name='M');
proc report data=sashelp.class;
where sex='M';
column name age height weight;
define name / group;
run;
ods excel close;



ods path (prepend) work.templat(update);
ods escapechar='^';
proc template;
define style styles.mystyle;
parent=styles.printer;
style table / just=l ;
style footer / just=r ;
end;
run;
filename temp email
from = "Ron.Einstein@BankLeumi.co.il"
to=("Ron.Einstein@BankLeumi.co.il")
subject="דוח רכבי הונדה"
type="text/html"
encoding='utf-8' 
/**Attach |Report XLSX FILE that we created before****/
attach = ("/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Class_Report.xlsx" 
content_type="application/vnd.openxmlformats- 
officedocument.spreadsheetml.sheet");
ods html body=temp style=styles.mystyle;
/****Report in Body email+Footnotes in Body email***/
FOOTNOTE1  justify=right  "שלום רב,";
FOOTNOTE2  justify=right   "להלן דוח רכבי הונדה";
proc report data=sashelp.cars contents="Honda Cars";
where Make="Honda";
column ("Car" make model) ("Cost" msrp invoice) ("Fuel Efficiency" mpg_city  mpg_highway);  
run;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2024 19:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/935395#M367770</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-10T19:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: sentences  from right to left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/936013#M367955</link>
      <description>&lt;P&gt;I ran your code on SAS On Demand and sent the email to myself.&lt;/P&gt;
&lt;P&gt;I opened the email on my Mac, using the MacOS standard mail client.&lt;/P&gt;
&lt;P&gt;The footnotes are right-justified, as they should be.&lt;/P&gt;
&lt;P&gt;On my Android table, Gmail showed them left-justified.&lt;/P&gt;
&lt;P&gt;So I think your email client is the culprit, as is Android Gmail.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 11:26:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sentences-from-right-to-left/m-p/936013#M367955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-17T11:26:59Z</dc:date>
    </item>
  </channel>
</rss>

