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

Hi All,

 

I have a dataset with date column which is in character format as below:

2021-02-03T10:20:00

-----T08:45:00

-----T09:08:00

2020-12-21T08:28:00

 

My requirement is to fill the missing date with day 1 of the current year and convert the date column into numeric format.

 

Also,

 

I have date values in character format as below

2020-12-22T15:19:00

2021-01-05T15:29

 

I would like to add 00 to the second record so that first record and second record have same format.

 

Kindly help.

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Fot the firrst scenartio I woiulr use compress to remove the dashes, and then concatenate with the date string of your choice.

 

If you store the result as a numrical datatime varible, you can chose a datetime format that will automatically display all values in the same format.

Data never sleeps

View solution in original post

1 REPLY 1
LinusH
Tourmaline | Level 20

Fot the firrst scenartio I woiulr use compress to remove the dashes, and then concatenate with the date string of your choice.

 

If you store the result as a numrical datatime varible, you can chose a datetime format that will automatically display all values in the same format.

Data never sleeps

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 679 views
  • 0 likes
  • 2 in conversation