これは簡単に思えますが、期待どおりに機能していません。
data names;
input name $12.;
cards;
John
Jacob
Jingleheimer
Schmidt
;
run;
data names;
length namelist $100.;
set names end=eof;
retain namelist;
if _n_=1 then namelist=name;
else namelist = namelist || "|" || name;
if eof then output;
run;
結果には、次のような1つの観測値が含まれると思います。
ジョン|ジェイコブ|ジングルハイマー|シュミット
しかしnamelist
、ただJohn
です。私は何が間違っているのですか?