How to avoid Linebreak in _webout?

I am building dynamically a very long string with variables encapsulated in HTML. Then I use ods HTML _webout to create an HTML page with information. My problem is that when String gets more than 4096 characters it creates a string. If this barcode is somewhere in HTML-Command it breaks my page. When I use LRECL it limits the value to 4096, no matter what value I use there. Sascode:

/*Some data generating and other stuff first which is not important here*/
...
/*then the output*/
data _null_;
set myData;
file _webout LRECL=32767;
put somedata;
/* somedata is like '<table><tr><td>someinformation</td> <td>moreinformation</td>...<td>lastinformation</td></tr></table>*/
run;

      

If I look at the source code of the page, it can happen something like this:

<tr><td>Info1</td><td>1</td><td>C</td><td>$1.</td></tr>...   ...<t
r><td>info80</td><td>10</td><td>C</td><td> </td></tr>

      

so it breaks after the 4096th character and doesn't write tr correctly (or other html code, depending on the Resultstring), resulting in incorrect display of the output.

I am creating a workaround for splitting the output string across multiple lines with a maximum length of 4000 and laying them all out, but this is not a good solution, can anyone give me a hint how to solve this more elegant one?

+3


source to share


2 answers


Ok, I found a solution for my problem, but I don't understand it; (

It depends on the encoding set for the website, so my testing with Sas 9.3 and IE8 gave the following results:

   file _webout LRECL=32767;
limited result to 1024 characters per line
   file _webout encoding=utf-8 LRECL=32767;
limited result to 4096 characters per line
   file _webout encoding=ANY LRECL=32767;
no visible limitation in my test cases

      

So, if anyone got the same problem, mayb, they can use a workaround by specifying the correct encoding value.

But maybe someone can explain why only the encoding value affects the length of the output line, but not the lrecl operator.



The answer to this techsupport question is:

LRECL works as documented, the problem is browsers specific, search browser options, maybe there is something you can activate or deactivate to solve your problem.

I haven't invested time looking for browsers that fix the problem because we have a lot of different clients (most of them are using IE8) that call processes and I can't reach everyone and tell them how to change their browser

My workaround: Split strings in smaller parts, or use encoding values.

+2


source


4096 sounds like a limitation of the editor used for viewing. Since you coded lrecl = 32767, I don't think you should have an HTML breaking issue at any point. Below is an example and you can view the source code in IE / Chrome / Firefox, the line is continuous and not broken. I assume you are hardcoding values, and that when the editor used to create the html table gets the line lined to 4096 without a dictionary, and you feel like the line is continuous, and when you copy the paste into the SAS Stored Process, you see break while displaying in browser



data _null_;
file _webout LRECL=32767;
put '<table><tr>';
do i =1 to 4000;
put '<td>' i 8. '</td>' @;
end;
put '</tr></table>';
run;

      

+1


source







All Articles