【发布时间】:2014-05-22 18:06:55
【问题描述】:
我刚开始使用 notepad++ 编辑 SAS 代码,发现我当前的 userDefineLang_SAS.xml 配置无法正确地将 SAS 代码块从“proc”折叠到“run”。
这是我在记事本++中的示例代码:
1 /*sample code*/
2 proc sort data=orion.usorders04
3 out=work.sort_usorders04;
4 by Customer_ID Order_Type;
5 run;
6
7 data discount1 discount2 discount3;
8 set work.sort_usorders04;
9 by customer_id order_type;
10 if first.order_type = 1 then totalsales=0;
11 totalsales + total_retail_price;
12 if last.order_type =1 and totalsales >= 100 then
13 do;
14 if order_type = 1 then output discount1;
15 if order_type = 2 then output discount2;
16 if order_type = 3 then output discount3;
17 end;
18 keep customer_id customer_name totalsales;
19 format totalsales dollar11.2;
20 run;
正如我所料,我希望第 2 到第 5 行可以折叠在一起。但是它并没有像我预期的那样折叠,而是将第 2 行到第 20 行折叠在一起。请参阅此链接中的示例图片:
https://drive.google.com/file/d/0B3-WolEQUW6ydHJ6Z3RxTEpRZlE/edit?usp=sharing
有趣的是,如果我在proc排序代码中取出“data=”,第2行到第5行可以折叠在一起。使用此链接查看示例图片:
https://drive.google.com/file/d/0B3-WolEQUW6ydFo3ZmNyODlZUnM/edit?usp=sharing
由于在 .xml 文件中,“data”和“proc”都被指定为折叠代码块的开始关键字,当 proc 和 data 都显示在 proc 排序代码中时,它会混淆 notepad++。我一直在尝试很多方法来调整 .xml 文件中的配置,但都不起作用。如果你有办法解决这个问题,请告诉我。谢谢!
【问题讨论】:
-
这个最好向N++的作者汇报
-
我也遇到了这个问题,无法找到解决办法 - 如果你找到了,请告诉我!
-
如果您可以使用折叠过程而不是数据步骤,那么您可以将
data从折叠关键字更改为常规关键字。