It would have helped to include a few examples of the data values you
have, or at least indicated exactly how the values "end with" the AM
and PM designations. Assuming that you mean the hh:mm:ss values
literally have "AM" or "PM" attached as a suffix, as in
09:15:33AM
11:34:12PM
you should be able to extract the relevant content and store it in a
new variable in SPSS's TIMEw format with something like this:
COMPUTE newtime=NUM(SUBSTR(oldtime,1,8),TIME8).
IF (SUBST(oldtime,9,2)='PM') newtime=newtime+TIME.DAYS(.5).
FORMATS newtime (time8).
LIST.
The first line pulls out the TIMEw content; the second adds
12 hours (i.e. .5 days) conditionally to those cases with a "PM"
designation, to adjust them for a 24-hour clock; the third
line formats the values to the hh:mm:ss display format.
You can adjust the "9" value among the SUBSTR arguments on the
conditional statement (second line) accordingly if there is a space
(or spaces) between the hh:mm:ss value and the "AM/PM" designation.
See your SPSS Syntax Reference Guide for details on the
capitalized commands and functions.
I hope these suggestions are useful,
Ed Tverdek