由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS QUESTIONS: Urgent time formating problem, please help!
相关主题
SAS simple question%do questions
WHICH ONE IS CORRECT?[合集] Question in Excel
问一个SAS的问题,急急!!SAS question:
问一个简单的SAS问题,多谢sas base问题
请教两个关于SAS的问题SAS input format question
请教个用SAS读数据的问题。[合集] a very simple question
SAS 编程问题 (有包子)asking a basic SAS queation
一个SAS 问题,紧急!请教:SAS table insert into table on MS SQL server
相关话题的讨论汇总
话题: sas话题: questions话题: formating话题: urgent话题: time
进入Statistics版参与讨论
1 (共1页)
g*********n
发帖数: 441
1
hey guys, i have format like 10175996, means the 10:17:59 in the morning,
however, if the digits behind the second larger than 30,i need to transfer
it to 101760. So in this case, 96 is larger than 30, it would be rounding
to 101760. Otherwise, if is 10175929 it still would be 101759. and i need
this format could be character.
I know it is not hard, but when i run some logic, the code would not work.
Any help would be highly appreciated!
Will send baozi, if any SAS code works.
Thanks a lot!
c***z
发帖数: 6348
2
use %% and %/% if you are using R
g*********n
发帖数: 441
3
i need to fix it by SAS. thanks!
x******n
发帖数: 173
4
if (mod(data, 100))>=30 then time = strip(data%1000000)||":"strip(mod(data,
1000000)%10000)||":"||...
something like that
you can figure out

【在 g*********n 的大作中提到】
: hey guys, i have format like 10175996, means the 10:17:59 in the morning,
: however, if the digits behind the second larger than 30,i need to transfer
: it to 101760. So in this case, 96 is larger than 30, it would be rounding
: to 101760. Otherwise, if is 10175929 it still would be 101759. and i need
: this format could be character.
: I know it is not hard, but when i run some logic, the code would not work.
: Any help would be highly appreciated!
: Will send baozi, if any SAS code works.
: Thanks a lot!

w*******n
发帖数: 469
5
is there the % operator in SAS?

【在 x******n 的大作中提到】
: if (mod(data, 100))>=30 then time = strip(data%1000000)||":"strip(mod(data,
: 1000000)%10000)||":"||...
: something like that
: you can figure out

x******n
发帖数: 173
6
that's what I said probably like that :)
I meant to provide a possible idea, not a final solution for that problem

【在 w*******n 的大作中提到】
: is there the % operator in SAS?
j******o
发帖数: 127
7
Not fancy, but should works.
------------------------------------
data have;
input time $;
datalines;
10175996
10175925
;
run;
data obtain;
set have;
if input(substr(time, 7,2), best12.)<=30 then time1=substr(time, 1, 6);
else do ;
x=input(substr(time, 1,6), best12.)+1;
time1=put(x,z6.);
end;
run;
------------------------------------

【在 g*********n 的大作中提到】
: hey guys, i have format like 10175996, means the 10:17:59 in the morning,
: however, if the digits behind the second larger than 30,i need to transfer
: it to 101760. So in this case, 96 is larger than 30, it would be rounding
: to 101760. Otherwise, if is 10175929 it still would be 101759. and i need
: this format could be character.
: I know it is not hard, but when i run some logic, the code would not work.
: Any help would be highly appreciated!
: Will send baozi, if any SAS code works.
: Thanks a lot!

1 (共1页)
进入Statistics版参与讨论
相关主题
请教:SAS table insert into table on MS SQL server请教两个关于SAS的问题
sas date variable exchange请教个用SAS读数据的问题。
character变date variable helpSAS 编程问题 (有包子)
一个很疑惑的SAS日期问题一个SAS 问题,紧急!
SAS simple question%do questions
WHICH ONE IS CORRECT?[合集] Question in Excel
问一个SAS的问题,急急!!SAS question:
问一个简单的SAS问题,多谢sas base问题
相关话题的讨论汇总
话题: sas话题: questions话题: formating话题: urgent话题: time