Another command possibly?

General discussion of the Co:Z Toolkit
Post Reply
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

Another command possibly?

Post by JohnMcKown »

I really appreciate your z/OS Co:Z toolkit stuff. I have run into one "need" which really isn't because I can likely do it another way. But to compliment the "fromdsn" to pull job output from the SPOOL into UNIX and the "lsjes" to show jobs, I could use something like "rmjes" to do two slightly different, but related, functions: cancel a running job and/or purge a job from the SPOOL. Now, I can do something like this by using REXX to issue an ADDRESS TSO "OUTPUT jobname(jesid) DELETE" or an ADDRESS TSO "CANCEL jobname" with an optional PURGE on the latter. I would guess the syntax would be something like: rmjes jesid where jesid is like with the -d jesid in the fromdsn -jes.jesid or the lsjes -d jesid. It would be "easier" in REXX to just use it the jobname or jobname(jesid) as the OUTPUT and CANCEL commands like, but not consistent with fromdsn and lsjes. Which I consider to be important for n00bies who are coming in from a UNIX or Windows environment with no TSO knowledge. Yes, I know that I could find the jobname from the jesid by using the lsjes command, something like:

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                                                                                        
Then it's easy to create the OUTPUT or CANCEL command and use the ADDRESS TSO. But I don't really like it. I'll use it, but I'd really like a better implementation. And maybe there is a better way to do it in REXX. I wouldn't be surprized.

Just something to consider.

--
John
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Another command possibly?

Post by dovetail »

We are aware of this requirements, especially related to cancel and purge for our Co:Z SFTP JES interface.
But these cancel and purge SSI functions require APF authorization :-(

As an alternative, you could write a REXX Unix script and use the SDSF interface to do this. We might consider implementing these shell commands that way and then spawning them from Co:Z SFTP when needed. This would require however that the user has SDSF installed.
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

Re: Another command possibly?

Post by JohnMcKown »

dovetail wrote:We are aware of this requirements, especially related to cancel and purge for our Co:Z SFTP JES interface.
But these cancel and purge SSI functions require APF authorization :-(

As an alternative, you could write a REXX Unix script and use the SDSF interface to do this. We might consider implementing these shell commands that way and then spawning them from Co:Z SFTP when needed. This would require however that the user has SDSF installed.
Is there any reason APF is a problem? extattr +a rmjes should take care of it. Unless Dovetailed Technologies has a comitment to not use any APF code.
The following extended attributes are defined:

a When this attribute is set (+a) on an executable program file (load
module), it behaves as if loaded from an APF-authorized library. For
example, if this program is exec()ed at the job step level and the
program is linked with the AC=1 attribute, the program will be
executed as APF-authorized.

To be able to use the extattr command for the +a option, you must
have at least read access to the BPX.FILEATTR.APF resource in the
FACILITY class profile. For more information about BPX.FILEATTR.APF,
see z/OS UNIX System Services Planning.
Post Reply