SAS中文论坛

标题: 求教: 如何在已有程序中添加新的变量 [打印本页]

作者: shiyiming    时间: 2010-4-2 00:15
标题: 求教: 如何在已有程序中添加新的变量
求教: 如何在已有程序中添加新的变量
比如
data exx;
infile  "e:\mysasdata\x000023.sas7bdat";               
input date $  y1-y6 x1-x6;

如何增加5个变量,改成
data exx;
infile  "e:\mysasdata\x000023.sas7bdat";               
input date $  y1-y8 x1-x9;

但是x000023.sas7bdat文件中只有date y1-y6 x1-x6;

请大虾指教,万分感谢!!
作者: shiyiming    时间: 2010-4-2 08:05
标题: Re: 求教: 如何在已有程序中添加新的变量
x000023.sas7bdat是SAS data set,用set语句读入就行,不用infile,input语句
增加的新变量y7,y8,x7-x9,是numeric的,值为missing吗?
[code:1w60td36]libname marshu 'e:\mysasdata\';
data exx;
        set marshu.x000023;
        call missing(y7,y8,x7,x8,x9);
run;[/code:1w60td36]
作者: shiyiming    时间: 2010-4-2 10:47
标题: Re: 求教: 如何在已有程序中添加新的变量
data exx;
   array more{*} y1-y8 x1-x9;*sorry, i rewrite the code;
   set x00023;
  run;




欢迎光临 SAS中文论坛 (http://www.mysas.net/forum/) Powered by Discuz! X3.2