Skip to content

Commit

Permalink
fix(desc_coun) 规避使用 CAT 函数家族导致变量被截断的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoopy1866 committed Mar 18, 2024
1 parent fb5ab06 commit 537306a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions gbk/desc_coun.sas
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Macro Name: desc_coun
Macro Label:定性资料描述性分析
Author: wtwang
Version Date: 2023-02-09 V1.11
2024-03-18 V1.12
===================================
*/

Expand Down Expand Up @@ -777,13 +778,13 @@ PARAM_LIST_BUFFER
(case
%if &IS_LABEL_INDENT = TRUE %then %do; /*首层缩进*/
%do i = 1 %to &var_n;
when strata = &i then cat(repeat("&INDENT", %eval(&i - 1)), cats(&&VAR_&i))
when strata = &i then repeat("&INDENT", %eval(&i - 1)) || strip(&&VAR_&i)
%end;
%end;
%else %do; /*首层不缩进*/
when strata = 1 then cats(&VAR_1)
when strata = 1 then strip(&VAR_1)
%do i = 2 %to &var_n;
when strata = &i then cat(repeat("&INDENT", %eval(&i - 2)), cats(&&VAR_&i))
when strata = &i then repeat("&INDENT", %eval(&i - 2)) || strip(&&VAR_&i)
%end;
%end;
end) as ITEM label = "指标",
Expand Down
7 changes: 4 additions & 3 deletions utf8/desc_coun.sas
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Macro Name: desc_coun
Macro Label:定性资料描述性分析
Author: wtwang
Version Date: 2023-02-09 V1.11
2024-03-18 V1.12
===================================
*/

Expand Down Expand Up @@ -777,13 +778,13 @@ PARAM_LIST_BUFFER 参数列表缓冲池
(case
%if &IS_LABEL_INDENT = TRUE %then %do; /*首层缩进*/
%do i = 1 %to &var_n;
when strata = &i then cat(repeat("&INDENT", %eval(&i - 1)), cats(&&VAR_&i))
when strata = &i then repeat("&INDENT", %eval(&i - 1)) || strip(&&VAR_&i)
%end;
%end;
%else %do; /*首层不缩进*/
when strata = 1 then cats(&VAR_1)
when strata = 1 then strip(&VAR_1)
%do i = 2 %to &var_n;
when strata = &i then cat(repeat("&INDENT", %eval(&i - 2)), cats(&&VAR_&i))
when strata = &i then repeat("&INDENT", %eval(&i - 2)) || strip(&&VAR_&i)
%end;
%end;
end) as ITEM label = "指标",
Expand Down

0 comments on commit 537306a

Please sign in to comment.