如何把数据集中的值替换并输入到txt文件中
1个回答
展开全部
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;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询