Help using Base SAS procedures

Hi

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Hi

my dataset like

date        time
19910426 1123
;
run;
date and time are character

i want to get output like

datetime
1991Mar26:11:23:00


Accepted Solutions
Solution
‎03-27-2012 07:46 AM
Respected Advisor
Posts: 3,124

Hi

data have;

input (date time) (:$);

cards;

19910426 1123

;

data want;

set have;

format dt datetime19.;

dt=dhms(input(date,yymmdd10.),0,0,input(time,b8601tm.));

put dt;

run;

Now, Do I get credit ?Smiley Wink

View solution in original post


All Replies
Solution
‎03-27-2012 07:46 AM
Respected Advisor
Posts: 3,124

Hi

data have;

input (date time) (:$);

cards;

19910426 1123

;

data want;

set have;

format dt datetime19.;

dt=dhms(input(date,yymmdd10.),0,0,input(time,b8601tm.));

put dt;

run;

Now, Do I get credit ?Smiley Wink

Occasional Contributor
Posts: 14

Hi

Thank U Hai.Kuo

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 196 views
  • 0 likes
  • 2 in conversation