2016-05-02 31 views
0

を超えるこんにちはSAS長さが最大長

proc sql; 
select cats('%run_procreg(name=',name,',month=',month,')') into :macrocalllist 
    separated by ' ' from dataset_a; 
quit; 


&macrocalllist; 

以下のコードを使用して、データセット内の各行のマクロを呼び出してしようとしているI「は可変的な最大長を取得してい'エラー:

SAS length of the value of the macro variable MACROCALLLIST (65540) exceeds the maximum length (65534). The value has been
truncated to 65534 characters.

データセットの行数のためです。あなたは回避策を提案できますか?

ありがとう、

+0

ですか? – superfluous

答えて

0

CALL EXECUTEが1つのオプションです。これにより、マクロ呼び出しをマクロ変数に格納することなく、データセットのデータを使用して一連のマクロ呼び出しを生成できます。例えば

%macro testprint(data=,obs=); 
    proc print data=&data (obs=&obs); 
    run; 
%mend testprint; 

data _null_; 
    input datasetname $13. obs; 
    call execute('%nrstr(%testprint(data='||datasetname 
           ||',obs='||put(obs,1.) 
           ||'))' 
       ); 
    cards; 
sashelp.shoes 3 
sashelp.class 5 
; 

とログが表示されます:あなたのデータセットにどのように多くの行

NOTE: CALL EXECUTE generated line. 
131 ; 
1 + %testprint(data=sashelp.shoes,obs=3)  
NOTE: There were 3 observations read from the data set SASHELP.SHOES. 
2 + %testprint(data=sashelp.class,obs=5)  
NOTE: There were 5 observations read from the data set SASHELP.CLASS. 
+0

はうまくいった!ありがとうございました。 – suven