SAS中文论坛

标题: 日期显示格式更改 [打印本页]

作者: shiyiming    时间: 2012-3-8 16:16
标题: 日期显示格式更改
请问:在SAS中,如何将200109这种格式变换为2001/09或者2001.09?
谢谢!!
作者: shiyiming    时间: 2012-3-9 00:30
标题: Re: 日期显示格式更改
[code:3akymxpj]data;
   ac ='200905'; *if the date is a string;
   an =input(ac, yymmn6.);
   put an=yymms.;
   an ='01may2009'd; *if the date is a numeric date;
   put an=yymms.;
run;[/code:3akymxpj]
JingJu
作者: shiyiming    时间: 2012-3-9 13:31
标题: Re: 日期显示格式更改
[quote="jingju11":1p3rz9nr][code:1p3rz9nr]data;
   ac ='200905'; *if the date is a string;
   an =input(ac, yymmn6.);
   put an=yymms.;
   an ='01may2009'd; *if the date is a numeric date;
   put an=yymms.;
run;[/code:1p3rz9nr]
JingJu[/quote:1p3rz9nr]
先谢过,去试试!
作者: shiyiming    时间: 2012-3-12 14:49
标题: Re: 日期显示格式更改
结果确实是有效的。学习了
作者: shiyiming    时间: 2012-3-13 07:06
标题: Re: 日期显示格式更改
[quote="jingju11":3m53558y][code:3m53558y]data;
   ac ='200905'; *if the date is a string;
   an =input(ac, yymmn6.);
   put an=yymms.;
   an ='01may2009'd; *if the date is a numeric date;
   put an=yymms.;
run;[/code:3m53558y]
JingJu[/quote:3m53558y]

Very efficient code, what a pro!
作者: shiyiming    时间: 2012-3-27 09:32
标题: Re: 日期显示格式更改
发贴时,那段代码是怎么打出来的呢?




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