Help using Base SAS procedures

To check overlapping data/time

Reply
Contributor
Posts: 27

To check overlapping data/time

********Sorry, Please Ignore This**************


Hi everyone,

I am trying to write a code to seperate records with overlapping dates. But I have datetime in iso format (2009-10-09T10:00). I seperated the date and time an concatenated them into a different character variable(09OCT2009:10:00). How do I convert this into a numeric variable where I can use operators such as less than and Greater than.

Thanks Message was edited by: madhu
SAS Super FREQ
Posts: 8,868

Re: To check overlapping data/time

Hi:
To change a character variable to a numeric variable, you can use the INPUT function. Since your character variable represents a date/time, you can use a date/time INFORMAT with the INPUT function to create a numeric variable that represents the number of seconds since midnight Jan 1, 1960.

There have been many previous posts in this forum and others on how to convert character date variables to numeric variables. If you either look in the documentation on INPUT and INFORMAT or search the forum postings, you should find some useful examples.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 190 views
  • 0 likes
  • 2 in conversation