Just missing a closing parenthesis after the local declarations, try this --
(defun c:h (/ ss)
(setvar "cmdecho" 0)
(prompt "\n*** Select objects for Hatch & press [Enter] ")
(if (and
(setq ss (ssget))
(> (sslength ss) 0)
)
(command "hatch" "" "" "" ss "")
)
(princ)
)