Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ISPF Skeletons
BY DENNIS BECK
TECHNICAL SUPPORT January ‘99 ©1999 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited.
S Y S T E M S
6. Define Tab standard positions using the )TB control statement Figure 1: GDGGEN REXX EXEC
or alternate tab positions using the )TBA control statement.
/* rexx exec to delete/define MVS GDG */
in the )TBA control statement (which we also not be covering). The /* see if the current dataset exists */
less than (<) and greater than (>) characters define a conditional /* if so set flag to include delete */
substitution string (which we will also not be covering). /* before define */
x = outtrap(“listcat.”); m = msg(‘off’)
Two consecutive control characters in the input record result in “listcat ent(‘“GDGNAME”’)”
one control character in the output record. The default control if listcat.0 \= 0 then do
characters are & ! < | >. This means that if you are using skeletons if listcat.1 = ‘GDG BASE ———’,
for JCL processing, all ampersands in the JCL must be replaced GDGNAME then
DEFINED = ‘YES’
with double ampersands. end
x = outtrap(“OFF”);m = msg(m)
THE SUBSTITUTION PROCESS
/* Look first in the current CLIST */
The substitution process used in file tailoring is almost exactly
/* dataset for skeletons */
like the process used in variable substitution used by JCL, including “ispexec libdef ispslib library id(sysproc)”
the use of ampersands and periods.
Every statement, except )CM statements, in the skeleton file is /* open the skeleton and output to */
/* temporary dataset */
scanned for the variable substitution start character, which defaults “ispexec ftopen temp”
to an ampersand. The characters following a variable start character
are interpreted as a variable name unless another ampersand follows, /* include and substitute the skeleton */
“ispexec ftincl GDGGENS”
which causes a single ampersand to be produced on the output
record. Variables are delimited on the right by blanks, the cent sign, /* close the output */
< ( + | & ! * ) ; ^ - / , % _ > : ‘ = and “. The variable is then looked “ispexec ftclose”
up, first in the local function pool, then in the shared variable pool,
/* after skeleton processing the ZTEMPF */
and finally the profile variable pool. After the variable’s value has /* shared variable contains the */
been determined, its value is substituted for the variable. Lines are /* temporary dataset name */
only scanned once for variable substitution. “ispexec vget (ztempf) shared”
ISPF supplies several useful built-in variables such as the USERID
/* if submit flag then just allow edit */
(ZUSER), current date (ZDATE), and time (ZTIME), which we will if (submit = ‘NO’) then
use in our example. File tailoring treats an ampersand blank combi- “ispexec edit dataset(‘“ztempf”’)”
nation as an invalid variable name. When a period is used to delimit a else /* submit the job */
“submit ‘“ztempf”’”
character string, the period is not copied to the output stream. In order
to have a period following a substitution variable in the output stream, exit 0 /* we are done
two periods must follow the variable in the input file skeleton.
©1999 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited. January ‘99 TECHNICAL SUPPORT
S Y S T E M S
Figure 2: GDGGENS File Tailoring Skeleton OPTIONS (additional parameters for the DEFINE GDG statement).
These variables have the same names as those used for variable
//&ZUSER.A JOB (ACCT,XXXX),’MAKE GDG’,
// CLASS=A,TIME=10,
substitution in the skeleton file, as all variables are retrieved from
// MSGCLASS=M,NOTIFY=&&SYSUID the local function pool.
//*******************************************
//* CREATE A GENERATION DATASET GROUP (GDG)
//* GENERATED BY &ZUSER ON &ZDATE AT &ZTIME
//*******************************************
//IDCAMS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=* The GDG example shows that the file-tailoring
//SYSIN DD *
)SEL &DEFINED = YES
facility is fairly easy to use and understand.
/* DELETE &GDGNAME
DELETE (&GDGNAME) +
*/
The usual method of cloning JCL from other
GENERATIONDATAGROUP
SET MAXCC = 0
individuals and modifying it to meet individual
)ENDSEL
/* DEFINE THE GDG &GDGNAME */
requirements could easily be replaced with a
/* WITH A LIMIT OF &GDGLIMIT GENERATIONS */
DEFINE GENERATIONDATAGROUP( +
more maintainable method using file skeletons
NAME(&GDGNAME) +
LIMIT(&GDGLIMIT) +
and a small investment of time and effort.
&OPTIONS)
/*
TECHNICAL SUPPORT January ‘99 ©1999 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited.
S Y S T E M S
Figure 3: Output of Command GDGGEN MY.GDG 20 (SC28-1273-01) http://ppdbooks.pok.ibm.com/cgi-bin/bookmgr/
bookmgr.cmd/BOOKS/ISPDGD01/CCONTENTS
//BECKDENA JOB (ACCT,XXXX),’MAKE GDG’,
// CLASS=A,TIME=10,
// MSGCLASS=M,NOTIFY=&SYSUID OS/390 V1R3.0 ISPF Services Guide (SC28- 1272-01) http://ppd-
//********************************************
//* CREATE A GENERATION DATASET GROUP (GDG)
books.pok.ibm.com/cgi-bin/bookmgr/bookmgr.cmd/BOOKS/
//* GENERATED BY BECKDEN ON 99/01/01 AT 19:19 ISPSER01/CCONTENTS
//********************************************
//IDCAMS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=* OS/390 V1R2.0 TSO/E REXX Reference (SC28-1975-00) http://ppd-
//SYSIN DD * b o o k s . p o k . i b m . c o m / c g i - b i n / b o o k m g r / b o o k m g r. c m d /
/* DELETE MY.GDG */
DELETE (MY.GDG) + BOOKS/IKJ3A300/CCONTENTS ts
GENERATIONDATAGROUP
/* DEFINE THE GDG MY.GDG */
/* WITH A LIMIT OF 20 GENERATIONS */
DEFINE GENERATIONDATAGROUP( +
NAME(MY.GDG) +
LIMIT(20) +
)
/*
debugging purposes, it is probably best to edit the output dataset NaSPA member Dennis Beck is a contract IBM systems programmer in the East Bay
rather than submit unconditionally. Area of San Francisco, Calif. He began his career 19 years ago as a 370 assembler
programmer, and has worked in a variety of industries including health care, retail,
THE SKELETON FILE wholesale, insurance, and at a software house. Currently, he has more than 11 years
The file GDGGENS shown in Figure 2 starts with a job card. as an IBM mainframe systems programmer in VTAM, NETVIEW, CICS, TCP/IP, and
Notice the use of the &ZUSER built-in variable to substitute the JES2. He can be reached at beckden@yahoo.com.
USERID into the JOBNAME. Also notice that the &SYSUID variable
has && preceding the JCL substitution variable so that one & will © 1999 Technical Enterprises, Inc. For reprints of this document
be copied to the output. contact editor@naspa.net.
We generate a JCL comment containing the user id, time, and
date of the file tailoring to give us some tracking. Notice how this
comment, which when following the normal method would
probably not be kept up to date, becomes easily maintainable when
using file tailoring. Also, if we go into an edit session after file
tailoring, we could save this JCL for the future and have a record
of when it was generated.
The )SEL command is used to conditionally include an
IDCAMS DELETE GENERATIONDATAGROUP depending on
the state of the &DEFINED variable. The &DEFINED variable
was set in the REXX EXEC if the GDG to be defined shows up in
a LISTCAT command.
Next, we create a comment in case we want to save the file
tailoring output. It is easy to be verbose when there is no possibility
of typing mistakes. Finally, we define the generation data group,
inserting the dataset name, the limit of generations to be kept and
any user-supplied options. Figure 3 shows the output of the file
skeleton process given the command “GDGGEN MY.GDG 20”;
note that if you are entering this from the command line, you must
prefix the command with “TSO”.
CONCLUSION
The GDG example shows that the file-tailoring facility is
fairly easy to use and understand. The usual method of cloning
JCL from other individuals and modifying it to meet individual
requirements could easily be replaced with a more maintain-
able method using file skeletons and a small investment of time
and effort.
REFERENCES
OS/390 V1R3.0 ISPF Dialog Developer’s Guide and Reference