BookmarkSubscribeRSS Feed
floflow
Calcite | Level 5

Hi,

 

I want to transform my hours that are currently in 12hour clock, with am pm to 24 hours clock

 

Thanks for your help! 

1 REPLY 1
PaigeMiller
Diamond | Level 26

First, you need to let us know if these are numeric variables (according to PROC CONTENTS) or character variables.

 

If numeric, probably the format TIMEAMPM. is assigned to this variable. All you need to do is assign the TIME. format to this variable.

 

In a data step, or PROC, use

 

format yourvariablename time.;
--
Paige Miller

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1555 views
  • 3 likes
  • 2 in conversation