Я хочу использовать оператор шага данных put
для написания HTML-кода и кода JavaScript.Хотя полученный HTML-файл выглядит так, как я хочу в браузере, я не знаю, как сделать так, чтобы код легко читался как в SAS EG, так и в полученном файле.
Я бы хотел, чтобы полученный файл имел возвраты каретки, вкладки и т. Д., Но не хотел бы добавлять кавычки в каждую строку.Кроме того, мне нужно, чтобы запустить в макросе.Я включил несколько попыток ниже.Это простой способ объединить читаемые результаты экс.2 и отл.3 с легкостью1, как вариант, чтобы установить?
/* Ex 1: Easy to read in SAS EG, but no tabs or carrige returns in html-file*/
data _null_;
file "C:\Test\test1.html" encoding="utf-8" ;
put " Some code
Some code on a new line
Some indented code";
run;
/* Ex 2: Tabs and line breaks in html file, but far more cumbersome to write in SAS EG.*/
data _null_;
file "C:\Test\test2.html" encoding="utf-8";
put @4 "Some code" /
@4 "Some code on a new line" /
@8 "Some indented code";
run;
/* Ex 3: Easy to read and write in SAS EG, reads well in html file. But won't run in a macro, and resolving macro variables is more trouble than with the methods above.*/
data _null_;
input ;
file "C:\Test\test3.html" encoding="utf-8";
put _infile_;
datalines;
Some code
Some code on a new line
Some indented code
;
run;