Hi:
If you have a character variable and you want to convert it to a numeric value for time (number of seconds since midnight), then you must use the INPUT function to turn your character value into a numeric variable.
For example, let's say that you have a variable called CHARTIME whose value is "06:51:23" and you want to convert that number to a SAS time value. Then your INPUT function would look something like this:
[pre]
sastime = input(chartime,time8.);
[/pre]
The INPUT function, converts a CHARACTER variable to a NUMERIC variable, using the INFORMAT that you specify as the second argument to the function. Now that SASTIME is internally stored as a number of seconds since midnight, you can now do a comparison. Assuming you mean you want to set a flag based on the time being before 3:00 PM (15:00:00), then your IF statement might look like this:
[pre]
if sastime le "15:00:00"t then newvar = 1;
else newvar = 0;
[/pre]
The documentation on SAS date and date/time and time variables is quite good and there are a lot of good examples of using the INPUT function in the documentation. The specification "15:00:00"t in the IF statement is called a "time constant" and, again, looking in the documentation on the use of SAS date, time and datetime constants will help you understand more about the task you want/need to do.
cynthia