Hello, if I understand correctly you are asking to read the footnotes in SAS from right to left since they are in Hebrew.
This is possible by combining a few different functions in a data step.
First, we will define our footnote1 and footnote 2 as variables inside a data step.
data _null_;
foot1 = 'שלום רב,' ;
foot2 = 'להלן דוח רכבי הונדה' ;
run;
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.
The next step is to use the scan function to extract each word from foot1 and foot2.
Here I create new variables, for each word of foot1 and foot2.
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.
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;
Now 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.
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;
I used the catx function here instead of the cat function so we could add a space (' ') between each word when they are combined.
The last part 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.
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.
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;
Finally, 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 '&'.
ods html body=temp ;
FOOTNOTE1 justify=right "&foot1_reverse";
FOOTNOTE2 justify=right "&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;
Hope this helps!
... View more