如何把数据集中的值替换并输入到txt文件中
答案:1 悬赏:20 手机版
解决时间 2021-03-14 19:10
- 提问者网友:最爱你的唇
- 2021-03-14 02:30
如何把数据集中的值替换并输入到txt文件中
最佳答案
- 五星知识达人网友:神鬼未生
- 2021-03-14 04:07
the macro variable temp created by call symput('temp', _infile_);
can not be used (by &temp) in the same data step.
It can be referenced after the data step have finished.
Don't know how to remove the warning. But the file 1234.txt was created correctly with maximum length of 10004.
There is not warning this way.
data _null_;
infile "F:\MySAS\Temp\output\long_string.txt" LRECL=32767;
file "F:\MySAS\Temp\output\12345.txt" LRECL=32767;
length x y temp $11000.;
retain temp;
if _n_ = 1 then do;
input;
temp = _infile_;
end;
set aaa;
p = find(x, 'abc');
if find(x, 'abc') then y= cats(substr(x, 1, p-1), temp, substr(x, p+3));
else y = x;
put @1 y;
run;
can not be used (by &temp) in the same data step.
It can be referenced after the data step have finished.
Don't know how to remove the warning. But the file 1234.txt was created correctly with maximum length of 10004.
There is not warning this way.
data _null_;
infile "F:\MySAS\Temp\output\long_string.txt" LRECL=32767;
file "F:\MySAS\Temp\output\12345.txt" LRECL=32767;
length x y temp $11000.;
retain temp;
if _n_ = 1 then do;
input;
temp = _infile_;
end;
set aaa;
p = find(x, 'abc');
if find(x, 'abc') then y= cats(substr(x, 1, p-1), temp, substr(x, p+3));
else y = x;
put @1 y;
run;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯