11Skeletons – Design and use

In this chapter, you will learn how you can create JCL members and other data elegantly by using ISPF skeletons. ISPF skeletons are members in a PDS/PDSE that are created with the editor. They are masks which are used for the management of any data structures. Skeleton members consist of basic texts, skeleton control statements and variable names. The variable names are replaced during processing of skeletons by the ISPF file-tailoring services by the actual values which are set in the processing REXX procedure. As with the panels, the variable names must not be longer than eight characters.

11.1Creating skeletons

For the creation of skeletons, the following commands are available:

Table 11.1: Commands to create skeletons

Command Function
)BLANK )BLANK 5 inserts 5 blank lines into the skeleton, which is being edited.
)CM With )CM, comment lines can be defined in the skeleton. These lines are not copied to the output component.
)DEFAULT To control the skeleton processing, seven special characters are reserved by default. These are the characters: ), &, ?, !, <, |, und >. With the )DEFAULT command these characters can be changed temporarily
)DOT Using these two statements, a loop can be formed.
)ENDDOT 
)IM This statement inserts another skeleton. The variables of the inserted skeleton will be dissolved and the result is added to the output component.
)SEL With )SEL a condition can be queried. If this condition is satisfactory, all the rows are
)ENDSEL processed until the next )ENDSEL.
)SET Assignments can be made by using this instruction.
)TB, )TBA Tab stops can be set by using this instruction.

Example:

The following skeleton adds a step into a job which executes instructions for DB2 BIND PACKAGE commands. The BIND PACKAGE instructions will not be executed in this job step; they are executed in the called REXX procedure VINTPAC.

JCL 11.6: Definition of a skeleton

image

Remarks:

I have grayed all relevant places for a skeleton definition.

In line 10 the skeleton $ISPFDD is inserted. This skeleton contains the necessary DD statements for execution of REXX procedures in an ISPF batch environment.

If a skeleton variable should be connected to another skeleton variable, a point is used as concatenation operator. If the resulting string is a DSN, an additionally point will be inserted for separating the single DSN qualifiers. DSNs are built in the lines 14 and 16. Therefore, here two consecutive dots are used to assemble DSNs.

Here are the statements of the REXX procedure VINTSN that processes this skeleton:

Coding 11.1: Skeleton processing

image

In this part of the program, most skeleton variables are filled with values. Some have already been set earlier in the procedure. When the statement FTINCL VINTPAC in line 3221 is executed, the following happens:

The member VINTPAC will be searched in the data set chain associated with the DD name ISPSLIB and inserted in an internal area.

Thereafter, the file-tailoring service is called. This processes the skeleton line by line.

The contents of the variables from the REXX/ISPF variable pool replaces the variables.

Any existing file-tailoring statements are executed. In this skeleton only one )IM statement is contained. The member $ISPFDD is searched in the ISPSLIB chain and inserted in the JCL stream. The variables contained in the member will be replaced by the actual values.

When the file-tailoring service has conducted all processing, the result is added to the internal data stream that has been opened with the FTOPEN statement.

When all file-tailoring work that is necessary to form a JCL member is finished in the procedure VINTSN, the created JCL member is saved using the command FTCLOSE NAME(name) LIBRARY(ddname). If ddname is not specified ISPFILE is used.

The job step created by the file-tailoring service looks as follows:

JCL 11.7: Job step created by the file-tailoring service

image

In the previous image, I grayed all the locations where values were inserted by variable substitution and all inserted rows.

11.2Steps to use the file-tailoring service

1.Use the ISPF editor to create a member in a PDS that is assigned under the DD name ISPSLIB for processing skeletons by a REXX procedure.

2.Create a REXX procedure where the variables are set used by the file-tailoring service to replace the corresponding variables of the skeletons.

3.Use in the REXX program the FTINCL service to insert a skeleton.

4.Use the FTCLOSE NAME(name) service to save the member name.

imageTip:
The file-tailoring service can also be used to generate any arbitrary data set.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221