Return to Mainframe Utilities Page

Module


/* REXX ***************************************************************/
/* Utility: CA7CMD                                                    */
/* Author: David Leigh                                                */
/* Function: This utility takes command line input to pass to CA7     */
/*           and return results to the user without having to go      */
/*           into CA7.  If it's in an edit session, it does this      */
/*           with note lines.  Otherwise it puts it into an output    */
/*           file and takes the user into edit on it.                 */
/*                                                                    */
/*           If it's not in an edit session, the whole command must   */
/*           be entered.  If it's in an edit session, the whole       */
/*           command can be entered but doesn't need to be.  If       */
/*           nothing is entered or partial commands, certain defaults */
/*           are used to construct an appropriate command for CA7.    */
/*                                                                    */
/*           To see the valid inputs available for the edit session   */
/*           method of invocation, type CA7CMD HELP or CA7CMD ? on    */
/*           the command line to get help information in note lines.  */
/**********************************************************************/

address ispexec "control errors return"
address isredit
"macro (passcmd)"
if rc = 0 then do
  ismacro = 'yes'
  if passcmd = "?" then do
    funcrc = cmd_help(ismacro)
    exit
  end
  if pos(',JOB=',passcmd) = 0 then do
    "(mbr) = member"
    if passcmd = '' then passcmd = 'LJCL'
    passcmd = passcmd ¦¦ ',JOB=' ¦¦ mbr
  end
end
else do
  parse upper arg passcmd
  ismacro = 'no'
  if passcmd = "?" then do
    funcrc = cmd_help(ismacro)
    exit
  end
end

if passcmd = '' then do
  address ispexec
  zedlmsg = 'please pass a valid ca7 command such that your ',
            'command looks like (for example):  ',
            'TSO CA7CMD LJOB,JOB=UFBL5305,LIST=ALL'
  "setmsg msg(utlz001w)"
  exit
end

address tso
dummy = outtrap('null.')
"FREE DD(SYSIN, SYSPRINT, UCC7CMDS TEMPCA7)"
"ALLOC DD(SYSIN) NEW"
"ALLOC DD(SYSPRINT) NEW SPACE(1,1) CYLINDERS RELEASE"
"ALLOC DD(UCC7CMDS) DSN('SYS3.CA7.PROD.COMMDS') SHR REUSE"

upper passcmd  /* CA-7 demands upper case commands */
passcmd = strip(passcmd,L,",") /* in case the user put in an extra ,*/

/**********************************************************************/
/* don't let an "frjob" go by without a "schid" or it will be too big!*/
/**********************************************************************/
if pos("FRJOB",passcmd) > 0 &,
   pos("SCHID=",passcmd) = 0 then do
   address ispexec
   zedlmsg = 'When using the FRJOB command, you must supply ',
             'a SCHID=nnn parameter or the command will be ',
             'too resource intensive.'
   "setmsg msg(utlz001w)"
   exit
end

zedlmsg = 'Calling CA7 with command:' passcmd
address ispexec "control display lock"
address ispexec "display panel(msgpanel)"

queue '/LOGON'
queue '/PROFS,ID=' ¦¦ sysvar(sysuid) ¦¦ ',R=CA70255'
queue PASSCMD
queue '/LOGOFF'

"execio" queued() "diskw sysin (finis)"

ADDRESS ISPEXEC "SELECT PGM(SASSBSTR) PARM(0,POOL=(1-8))"

"execio * diskr sysprint (stem result. finis)"

"FREE DD(SYSIN, SYSPRINT, UCC7CMDS TEMPCA7)"
drop null.

if ismacro = 'yes' then do
j = result.0 - 5 /* this gets rid of trailer lines*/
  address isredit
    do i = 14 to j
      line = substr(result.i,2) /* this gets rid of carriage control */
      "line_before .zfirst = msgline <1,(line)>"
    end
  end
else
  do
  tempdsn = sysvar(sysuid) ¦¦ '.tempca7.d' ¦¦ date(j) ¦¦ '.t' ¦¦ time(s)
    address tso
    "ALLOC DD(TEMPCA7) DSN('"TEMPDSN"')",
           "NEW",
           "VOLUME(WRK$$$)",
           "SPACE(1,1) TRACKS RELEASE",
           "RECFM(F B A) LRECL(133)"
    "execio * diskw tempca7 (stem result. finis)"
    "FREE DD(TEMPCA7)"
    address ispexec
    "edit dataset('"tempdsn"')"
  end

exit

/**********************************************************************/
/* The following procedure gives a few handy CA7 commands that can    */
/* be executed via CA7CMD.  This list is, by no means, exhaustive     */
/* but can be expanded as people think of good example commands.      */
/**********************************************************************/
cmd_help: procedure

arg ismacro

if ismacro = "NO" then do
  jobstr = ",JOB=xxxxxxxx"
  address tso "clear"
end
else do
  jobstr = ""
  address ispexec "control display lock"
end

say "CA7CMD - Example CA7 commands"
say ""
say "Here are some example CA7 commands that you may find helpful. To have this"
say "list updated, see someone on the Tools team."
say ""
say "LJOB"jobstr",LIST=TRIG"
say "     This command shows all the jobs which trigger this job and which this"
say "     job triggers"
say "LJOB"jobstr",LIST=RQJOB"
say "     This command shows all the requirements that this job has.  This is"
say "     where you find job dependencies and negative dependencies."
say "LJCL"jobstr
say "     This command shows you in which library this job resides as far as"
say "     CA7 is concerned.  It also shows you the JCL that CA7 has for that"
say "     job right now.  *** if you don't enter a command, this is the default"
say "LJOB"jobstr",LIST=DEPJ"
say "     This command shows a list of all jobs that are dependent on the job"
say "     being displayed, including negative dependencies"
say "LJOB"jobstr",LIST=RQUSR"
say "     This command lists any user requirements on the job"
say "LJOB"jobstr",LIST=NODD"
say "     This command shows everything except STEPDD information"
say "LJOB"jobstr",LIST=SCHD"
say "     This command displays schedule information (works on base"
say "     calendar jobs only)"
say "LJOB"jobstr",LIST=RQVRM"
say "     This command displays Virtual Resource Manager requirements for"
say "     a job"
say "LDSN,DSN=USC10.SLSS.MASTER,LIST=USERS"
say "     This command lets you find out which jobs use a specific dataset"
say "LRLOG"jobstr",DATE=*"
say "     This command shows the last 5 day's runlog for this job"
say "LPRRN"jobstr
say "     This command shows detail about the last run for this job"
say "FSTRUC"jobstr",SCHID=nnn"
say "     This command shows the subsequent job triggering path starting at"
say "     this job"
say "FRJOB"jobstr",SCHID=nnn"
say "     This command shows which base calendar job will eventually trigger"
say "     this job.  Note: it requires a SCHID!"
say "*** Press  twice to return ***"
pull stuff

return 0
            


Documentation


 The CA7CMD utility allows you to invoke CA7 commands from anywhere
 within ISPF without having to go in and out of the CA7 environment.  It
 uses the CA7 batch terminal feature so its performance is not the best,
 but its primary benefit is convenience.

 It is implemented as both a standard REXX that can be executed via the
 "TSO xxxx" style of invocation as well as as an ISPF edit macro.  The
 advantage of using it as an edit macro is that when you are editing JCL
 whose member name matches the member name of the JCL in CA7, you have
 the ability to just type "CA7" on the command line and you'll
 automatically have an LJCL,JOB=themembername command issued to CA7 and
 the results returned as message lines in your edited JCL.
 Alternatively, you could issue the command "CA7CMD LJOB" and it would
 issue the LJOB,JOB=themembername command and once again, your data is
 returned to the member.  You also have the capability of putting other
 parameters on the command if you so desire.  For instance, you might
 want to issue the LJOB command with a "LIST=TRIG" paramter.  You would
 just type CA7CMD LJOB,LIST=TRIG and CA7CMD would put the job name in
 there for you and return the results.

 If you're executing it as you would a typical Rexx or Clist (i.e. not
 an edit macro), you need to supply the full command.  For example, you
 could type CA7CMD LJOB,JOB=yourfavoritejob,LIST=RQJOB on any ISPF
 command line and press ENTER.  The results are written to a dataset and
 you are taken into an edit session on that dataset.  This is also a
 good way to capture CA7 command that you need in a dataset for whatever
 reason.
            


Archives

Categories

Important links

leighweb.com – our family web site
surleslinteaux.leighweb.com – my wife’s French Sunday School blog
eglisejosue.fr – our church in France
tdr-guebwiller.eu – our house of prayer (HOP) in France
informatique.leighweb.com – My web development freelance business
My CV/Resume in English (PDF)