| Date: | Thu, 2 Dec 2004 18:43:21 -0500 |
| Reply-To: | "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM> |
| Subject: | Re: ODS Tagset variable limitations? |
|
On Thu, 2 Dec 2004 10:50:25 -0800, M.Jessup <mjessup@YAHOO.COM> wrote:
>I have been developing a custom tagset, and have run into a situation
>where it seems a memory variable is being truncated. It is happening
>in the following code which replaces leading spaces with HTML
>non-breaking spaces:
>
>eval $spaces prxparse('s/ / /');
>eval $REPLACED prxchange($spaces, -1, VALUE);
>put $REPLACED;
>
>Is there a limitation to the storage for memory variables? Is it a
>limitation to the regex package? I can find no documentation to
>suggest what the cause of the problem might be. Any insight would be
>greatly appreciated.
Hi, M.Jessup,
It seems like the prxchange() called within proc template returns a string
of length 200. I wasn't able to lengthen the return value, even when I set
the variable to a longer-than-200-char before calling the prxchange().
Cheers,
Chang
<sasl:code sysscp="WIN" sysver="9.1">
%macro c220;
%local i ten r;
%let ten=----+----1;
%do i = 1 %to 22;
%let r=&r.&ten.;
%end;
%*;&r.
%mend;
data one;
length a $220;
a = repeat("A", 220-1);
run;
ods path work.tmp(update) sashelp.tmplmst(read);
proc template;
define tagset tagsets.mine;
output_type = 'html';
define event doc;
start:
putl "<html><body>";
finish:
putl "</body></html>";
end;
define event data;
start:
set $replaced "%c220";
eval $len_before_replaced length($replaced);
eval $len_value length(value);
eval $prx prxparse("s/A/B/");
eval $replaced prxchange($prx, -1, value);
eval $len_after_replaced length($replaced);
putl "<p>";
putl "len_value=" $len_value;
putl "<br>len_before_replaced=" $len_before_replaced;
putl "<br>len_after_replaced=" $len_after_replaced;
putl "</p>";
finish:
putl;
end;
end;
run;
ods markup type=tagsets.mine file="c:\test.html";
proc print data=one noobs;
var a;
run;
ods markup type=tagsets.mine close;
ods path reset;
/* on web page
len_value=220
len_before_replaced=220
len_after_replaced=200
*/
</sasl:code>
|