我有一个包含30多列的WORK数据集,但只有2列是日期字段。 (开始日期和结束日期)。我希望永久数据集中的日期格式是日期。而不是在yymmdd10。这是工作数据集中的当前格式。当我使用下面的代码时,两个日期字段占据前两个位置。我不想重新排序位置,同时不想提及所有30多列的格式。如果有任何办法,有人可以帮助我吗?
data DLR.DEALER;
set work.dealer_invoices; * this dataset contains more than 30 columns;
format start_dt end_dt date.;
run;
我在我们的网站上找不到任何解决方案。任何帮助都非常感谢,而不仅仅是要求我提及格式声明中的所有列:)提前感谢。
答案 0 :(得分:1)
Certainly the format statement shouldn't have any impact on ordering given its location.
A workaround would be to use PROC DATASETS
to change the format instead of in the data step.
You also could "mention all columns" fairly easily.
proc sql;
select name into :namelist separated by ' '
from dictionary.columns
where libname='WORK' and memname='DEALER_INVOICES'
order by varnum;
quit;
then
data DLR.DEALER;
retain &namelist;
set work.dealer_invoices;
format...;
run;