BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cello23
Quartz | Level 8

Hello guys,

i do convert this time stamp:

23DEC2004:20:02:53.000000 (char25)

in

23DEC2004  (date9.)

Please, help.

Thank's

1 ACCEPTED SOLUTION

Accepted Solutions
shivas
Pyrite | Level 9

Hi,

Try this..

data test;

input time $ 25.;

date=input(time,date9.);

format date date9.;

cards;

23DEC2004:20:02:53.000000

;

run;

Thanks,

Shiva

View solution in original post

3 REPLIES 3
shivas
Pyrite | Level 9

Hi,

Try this..

data test;

input time $ 25.;

date=input(time,date9.);

format date date9.;

cards;

23DEC2004:20:02:53.000000

;

run;

Thanks,

Shiva

Cello23
Quartz | Level 8

Smiley Wink

Thank's

mojerry2
Fluorite | Level 6

the datepart function converts an integer datetime to an integer date value.

the example here converts text datetime to integer date.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 31342 views
  • 1 like
  • 3 in conversation