楼主: pinggu2688
6348 6

[问答] 求返回当前时间的系统自带宏变量 [推广有奖]

  • 2关注
  • 0粉丝

博士生

6%

还不是VIP/贵宾

-

威望
0
论坛币
40 个
通用积分
40.2335
学术水平
1 点
热心指数
3 点
信用等级
1 点
经验
3113 点
帖子
166
精华
0
在线时间
103 小时
注册时间
2009-11-12
最后登录
2024-8-28

楼主
pinggu2688 发表于 2012-3-15 22:08:23 |AI写论文
10论坛币
类似 :%put &time;  ??

关键词:time IME put Tim

沙发
jinlin2009 发表于 2012-3-15 23:24:19
&systime 这个是返回小时+分
&sysdate 这个是日期

藤椅
pinggu2688 发表于 2012-3-16 02:46:41
jinlin2009 发表于 2012-3-15 23:24
&systime 这个是返回小时+分
&sysdate 这个是日期
It seems that &systime just return the time when the current sas section start. but not the current time.if you run &systime many times you will find that is a same value.
Sorry for typing in english because this computer no Chinese input.

Thank you.

板凳
jinlin2009 发表于 2012-3-17 01:18:16
那就是%sysfunc(time())

报纸
pinggu2688 发表于 2012-3-17 04:06:33
thank jinlin2009
I get one solution but it seems not too smart:
%put %sysfunc(putn(%sysfunc(timepart(%sysfunc(DATETIME()))),time8));
does anyone have better idear?

Thanks

地板
情迷仲夏夜 发表于 2012-3-17 04:49:14
%put %sysfunc(putn(%sysfunc(datepart(%sysfunc(DATETIME()))),date9.));

7
情迷仲夏夜 发表于 2012-3-17 04:57:22
you can use even more simple macro statment:
%put %sysfunc(time(),time8);
%put %sysfunc(datetime(),datetime20);

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-6 07:49