Code: Select all
/* rexx */
parse arg jesid .
error=""
i=verify(jesid,'0123456789','M')
if (i<2 | i>4 | length(jesid) > 8) then error="is not a valid jes identifier"
else do
type=left(jesid,i-1)
upper type
number=substr(jesid,i)
if (0=datatype(number,'W')) then error="is not a valid jes identifier"
i=abbrev('JOB',type,1)+2*abbrev('STC',type,1)+4*abbrev('TSU',type,1)
if (0=i) then error='is not a valid jes identifier'
end
if (""<>error) then do
error="rmjes:"jesid||error||ESC_N
address syscall "write 2 error"
exit 1
end
if i=1 then jesid='JOB'
if i=2 then jesid='STC'
if i=4 then jesid='TSU'
jesid=jesid||right(number,5,'0')
call bpxwunix "lsjes -p '*' -o '*' -t | awk '$1=="""jesid""" {print $2;}'",,stdout.,stderr.
if (0=stdout.0) then do
error='rmjes: 'jesid' cannot be found for some reason.'||ESC_N
address syscall 'write 2 error'
do i=1 to stderr.0
error=stderr.i||ESC_N
address syscall 'write 2 error'
end
exit 1
end
Just something to consider.
--
John