|
|||||||||||
|
Chicago-Soft
|
Running ISPF
Edit Macros in Batch Running an ISPF Edit Macro in batch can be a useful tool. One of the most useful tasks that I have accomplished using this process, is to create a list of datasets which exist on the system. For example you could run a listcat job in batch for all datasets with the high level qualifier of "TEST". Have the output of this job go to a dataset which is then cataloged. In the next step of the batch job you can run an edit macro which performs various types of edit commands to clean up the Listcat output and leave you with a list of dataset names that actually exist on the system. By being able to run the Edit Macro in batch you can create a single job stream to complete this entire process and this job could be run periodically as needed. Here is sample JCL which can be used for batch execution of an Edit Macro:
//* ****************************
//* *** EXECUTE TSO IN BATCH ***
//* ****************************
//TSOBTCH1 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//ISPLOG DD DSN=COMMON.ISPFBTCH.LIST,DISP=SHR (A)
//ISPPROF DD DSN=COMMON.ISPFBTCH.PROFILE,DISP=OLD (B)
//ISPMLIB DD DSN=SYS1.ISPF.MLIB,DISP=SHR
// DD DSN=SYS2.ISPF.MLIB,DISP=SHR (C)
// DD DSN=SYS4.ISPF.MLIB,DISP=SHR
//ISPPLIB DD DSN=SYS1.ISPF.PLIB,DISP=SHR
// DD DSN=SYS2.ISPF.PLIB,DISP=SHR (D)
// DD DSN=SYS4.ISPF.PLIB,DISP=SHR
//ISPSLIB DD DSN=SYS1.ISPF.SLIB,DISP=SHR
// DD DSN=SYS2.ISPF.SLIB,DISP=SHR (E)
// DD DSN=SYS4.ISPF.SLIB,DISP=SHR
//ISPTLIB DD DSN=SYS1.ISPF.TLIB,DISP=SHR
// DD DSN=SYS2.ISPF.TLIB,DISP=SHR (F)
// DD DSN=SYS4.ISPF.TLIB,DISP=SHR
//ISPTABL DD DSN=SYS1.ISPF.TLIB,DISP=SHR
//SYSPROC DD DSN=COMMON.REXX.DATASET,DISP=SHR (G)
// DD DSN=SYS1.CMDPROC,DISP=SHR
// DD DSN=SYS2.CMDPROC,DISP=SHR (H)
// DD DSN=SYS4.CMDPROC,DISP=SHR
//SYSTSIN DD *
PROFILE PREFIX(TsoUserid) (I)
ISPSTART CMD(%EDITREXX file.to.be.edited MACRO1) (J)
/*
Footnotes:
(A) Required ISPF dataset, can be modeled from the &zuserid.spflog1.list dataset
- must be a name that all users of this jcl have 'write' access to.
(B) Required ISPF dataset, can be modeled from the &zuserid.ispprof
- must be a name that all users of this jcl have 'write' access to.
(C) Standard system ISPF Message library datasets required for your environment.
(D) Standard system ISPF Panel library datasets required for your environment.
(E) Standard system ISPF Skeleton library datasets required for your environment.
(F) Standard system ISPF Table library datasets required for your environment.
(G) At least one of the datasets in the SYSPROC list must contain the Edit Macro
to be executed in batch as well as the REXX program 'EDITREXX'. see note (J).
(I) The string "TsoUserid" must be replaced with the valid TSO ID of the person
running this job.
(J) The REXX program EDITREXX (see source below), must exist in a common system
REXX or CLIST dataset. The string "file.to.be.edited" should be replaced with
the name of the dataset that you wish to run the Edit Macro against. The string
"MACRO1" is the name of the edit macro to be executed.
Here is the source listing for the REXX exec which controls the Execution of the Edit Macro:
/* REXX */
/* ------------------------------------------------------------------ */
/* All REXX reserved words are shown in CAPS and all user */
/* defined variables are shown in 'lower case'. */
/* ------------------------------------------------------------------ */
PARSE ARG filename macro1
ADDRESS ISPEXEC
"EDIT DATASET('"filename"') MACRO("macro1")"
I have found that it is best to develop the Edit Macro using standard techniques of running it in an interactive mode before putting it into the batch job stream. This is generally faster and easier to test the various edit commands. About the Author:
Gary Frickey has been developing tools and utilities in ISPF and REXX
since 1985. He is currently employed with Management Compensation Services
in Scottsdale, AZ, a division of Hewitt Associates LLC. He can be reached
via e-mail at gary.frickey@bigfoot.com.
Assistance in developing this process was also provided by LaRoy Smith. |
|
||||||||
home · current
articles
· archives · forums · |