File-tailoring services read skeleton files and write tailored output that can be used to drive other functions. Frequently, file tailoring is used to generate job files for batch execution.
This statement marks the beginning of file-tailoring process. It opens the output dataset where the tailored data will be stored.
Here 'TEMP' is optional.
'TEMP' is specified - File-tailoring will be performed in a temporary dataset.
'TEMP' is omitted - the tailored output will be stored in the dataset assigned to the ddname 'ISPFILE'.
This statement performs the actual file-tailoring process. It accesses the skeleton from ISPSLIB and performs file-tailoring.
"FTINCL skelmem [NOFT]"
'skelmem' denotes the name of the skeleton.
If NOFT is specified, no tailoring will be performed and is equivalent to copy.
When the file-tailoring is performed, the variables placed in the skeleton will be substituted with the values passed from REXX.
This statement stores the tailored output in the output dataset and closes it.
"FTCLOSE [NAME (outmem)] [LIBRARY(outds)] [NOREPL] "
Outmem: Output Member name output is PDS.
Outds: Name of DD where output is saved. Default is ISPFILE.
NOREPL: If specified, the existing member will not be overlaid.
This statement erases a member from file-tailoring output library.
"FTERASE member [LIBRARY(outds)] "
Outmem – Member to be deleted from file-tailoring library.
Outds - Name of the library where the member resides.
)CM skeleton program to generate job name based on user id. )SET FLN = IBMMF.SAMPLE.FILE //&USR.A JOB ,'&USR',CLASS=A,MSGCLASS=X,NOTIFY=&USR, // MSGLEVEL=(1,1) //* //PROG EXEC PGM=SAMPLE //INPUT DD DSN=&FLN
/* REXX */ /* REXX TO PERFORM FILE TAILORING USING SKELETONS */ USR = 'IBMMF' ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('SKEL.DATASET')" "FTOPEN TEMP" "FTINCL SKELMEM" "FTCLOSE" "VGET (ZTEMPF) SHARED" "VIEW DATASET('"ZTEMPF"')" EXIT 0
When the above mentioned skeleton is tailored using the REXX the output will be as given below:
//IBMMFA JOB ,'IBMMF',CLASS=A,MSGCLASS=X,NOTIFY=&USR, // MSGLEVEL=(1,1) //* //PROG EXEC PGM=SAMPLE //INPUT DD DSN=IBMMF.SAMPLE.FILE
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!