记事本++不能折叠SAS proc ... run;代码正确

时间:2014-05-22 18:06:56

标签: sas notepad++

我刚开始使用notepad ++来编辑SAS代码,发现我当前的userDefineLang_SAS.xml配置无法正确地折叠来自" proc"到"跑"。

以下是我在记事本++中的示例代码:

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

有趣的是,如果我拿出" data ="在proc分类代码中,第2行到第5行可以折叠在一起。使用此链接查看示例图像:

https://drive.google.com/file/d/0B3-WolEQUW6ydFo3ZmNyODlZUnM/edit?usp=sharing

因为在.xml文件中,所有"数据"和" proc"被指定为折叠代码块的开始关键字,当proc和amp;时,它会混淆notepad ++。数据显示在proc排序代码中。我一直在尝试很多方法来调整.xml文件中的配置,但所有方法都不起作用。如果您有办法解决这个问题,请告诉我。谢谢!

1 个答案:

答案 0 :(得分:1)

我遇到了这个问题,经过多次修修补补后,我发现了一些对我有用的东西。我不确定你的完整语言是如何定义的,但是将数据=作为代码1中折叠的中间标准部分适用于我的情况:

Folding SAS Lines