Gary, I have this sql in a script I am using right now to move the database to new volumes.
upd scr add-dbcopy 'select ''ok'' from status where hour(current_time) - 7> 0' upd scr add-dbcopy 'if(rc_notfound) goto do_moves' To do what you want I suggest - upd scr add-dbcopy 'select ''ok'' from status where hour(current_time) - 4< 0' upd scr add-dbcopy 'if(rc_ok) goto process' upd scr add-dbcopy 'select ''ok'' from status where hour(current_time) - 9> 0' upd scr add-dbcopy 'if(rc_ok) goto process' upd scr add-dbcopy 'exit' ( ok, I just tested something better - upd scr add-dbcopy 'select ''ok'' from status where hour(current_time) between 4 and 8' upd scr add-dbcopy 'if (rc_ok) exit' ) Hope this helps, Bill Colwell Draper Lab -----Original Message----- From: ADSM: Dist Stor Manager [mailto:[EMAIL PROTECTED] On Behalf Of Lee, Gary D. Sent: Wednesday, January 31, 2007 8:03 AM To: ADSM-L@VM.MARIST.EDU Subject: Getting and using time values with sql Tsm server 5.2.9.0, running on solaris 2.8. I would like to restrict a tsm script from running between the hours of 4:00 and 9:00 aa.m.. I haven't figured out how to test the value of time in a script, and branch on that test. Any pointers would be helpful. Gary Lee Senior System Programmer Ball State University