BTB (Batch Template Build)

Purpose
To produce multiple templates from a PDS of copybooks in batch.
Usage notes
You can select the copybooks from which templates are to be produced by member name selection criteria.
Related functions
BTU
Batch template update
Figure 1. Syntax

1 BTB
1! INPUT=DDIN
1 INPUT=ddname
1 DSNIN=dsname
1 ? MEMSTART=startstring? MEMEND=endstring
1 MEMBER=member_in
3? XMEMBERS=(+ ,xmem_filter)
3? MEMLIST=(+ ,member_n?(template_n))
1! OUTPUT=DDOUT
1 OUTPUT=ddname
1 DSNOUT=dsname?(member_out)
4? MEMOUT=memmask
1! REPLACE=NO
1 REPLACE=YES
5?  %Copybook processing
Copybook processing

1! LANG=AUTO
1 LANG=
2.1 COBOL
2.1 PLI
2.1 HLASM
1  %COBOL options
1  %PL/I options
1  %HLASM options
COBOL options

1! DBCS=NO
1 DBCS=YES
1! CDPC=NO
1 CDPC=YES
1! CAE=NO
1 CAE=YES
1! MIXED=NO
1 MIXED=YES
1 +  RFROMn=operand1 RTOn=operand2
1! CBLMAXRC=4
1 CBLMAXRC=num
1 CBLLIBS=(+  dsname)
8? CBLADDOP=options
PL/I options

1! BIN63=NO
1 BIN63=YES
1! DEC31=NO
1 DEC31=YES
1! GRAPHIC=NO
1 GRAPHIC=YES
1! UNALIGNED=NO
1 UNALIGNED=YES
1! PLIMAXRC=4
1 PLIMAXRC=num
1 PLILIBS=(+  dsname)
7? PLIADDOP=options
HLASM options

1! DBCS=NO
1 DBCS=YES
1! NOALIGN=NO
1 NOALIGN=YES
1! ASMMAXRC=4
1 ASMMAXRC=num
1 ASMLIBS=(+  dsname)
5? ASMADDOP=options
INPUT=ddname
This points to the input DD name which can have one or more associated data sets that must be valid copybook data sets. If Panvalet or Carma data sets are referred to, then they must all be Panvalet or CARMA data sets. You cannot mix. If you do not specify INPUT or DSN parameters, then the DD DDIN is used as a default DD name for the input data sets.
DSNIN=dsname
Data set name where copybooks reside.
MEMBER=member_in
The name of a single member in a PDS, or a member name pattern representing one or more members in a PDS to be processed.

A member name pattern can consist of any characters that are valid in a member name and two special pattern characters: the asterisk (*) and the percent symbol (%).

*
represents any number of characters. As many asterisks as required can appear anywhere in a member name pattern. For example, if you enter a member name pattern of *d*, all members in the PDS whose name contains “d” are processed.
%
is a place holding character that means a single character. As many percent symbols as necessary can appear anywhere in a member name pattern. For example, if you enter a member name pattern of %%%%, all members in the PDS whose name is four characters in length are processed.

member_in is ignored if the data set is not a PDS.

MEMSTART=startstring
Is used to specify the start of a range of member names to be included. If MEMSTART is specified but MEMEND is omitted, all members of the PDS(E) from the startstring value onwards are included. startstring can have the same values, including wild cards, as for the member-in parameter of the MEMBER keyword.
MEMEND=endstring
Is used to specify the end of a range of member names to be included. If MEMEND is specified but MEMSTART is omitted, all members of the PDS(E) up to the endstring value onwards are included. endstring can have the same values, including wild cards, as for the member_in parameter of the MEMBER keyword.
XMEMBERS
Provides a way to exclude from processing library members that would otherwise be selected using the MEMSTART, MEMEND, and MEMBER options.
xmem_filter
A member name filter identifying one or more members that are to be excluded from processing. A filter can be a member name pattern representing multiple members.

To specify a member name filter containing lowercase characters, use a character string in the format c'string'. Filter values can also be specified as hexadecimal strings in the format x'hex-digits'.

MEMLIST
Allows you to specify a list of member names with optional associated output template names. If you do not specify the associated template name, File Manager uses the copybook name or the name as identified by the MEMOUT mask, memmask.
member_n
The name of the member to be processed. Generic name masks are allowed.
template_n
The name of the template after it has been copied to the output data set. If unspecified, the output template is not renamed.
OUTPUT=ddname
Identifies the DD card which points to the template data set in which the templates are stored or replaced. It must refer to a PDS, PDSE, or sequential data set. Concatenated data sets are not supported.
DSNOUT=dsname
Defines the data set name where templates are created. It must be a PDS, PDSE, or sequential data set. You can further describe this data set, as follows:
(member-out)
Where DSNOUT=dsname specifies a PDS and you want to send the output to a specific member within this data set, this defines the output member name.
MEMOUT=memmask
Where a number of input members have been specified, you can specify a member name pattern for the output templates, allowing you to rename your templates as they are created. The member name pattern can consist of any characters that are valid in a member name and two special pattern characters: the asterisk (*) and percent sign (%).
Asterisk (*)
The asterisk is a place-holding character that means multiple characters with no change. Only one asterisk should appear in the mask. Any subsequent asterisk characters are treated as percent signs. For example, if you enter:
ABC*

The renamed members all begin with ABC followed by the remainder of the old member name.

Percent sign (%)
The percent sign is a place-holding character that means a single character with no change. As many percent symbols as necessary may appear anywhere in a member name. For example, if you enter:
%%%A*
The 1st 3 characters of the renamed members remain unchanged, the 4th character is replaced with the letter “A” and the remainder of the old member name remains unchanged.
REPLACE
Specifies whether or not File Manager replaces like-named templates in an output partitioned data set.
NO
Like-named templates in the output partitioned data set are not replaced.
YES
Like-named templates in the output partitioned data set are replaced.
Copybook processing
If you specify a copybook (instead of an existing template), File Manager uses these processing options to compile the copybook into a template:
LANG
Determines whether File Manager automatically detects the copybook language or interprets the language as COBOL, PL/I, or HLASM.
Note: The COMPLANG setting in FMN0POPT is the equivalent of the LANG parameter in batch functions.
  • If COMPLANG is set it determines the installation default language for online and batch compilation.
  • If COMPLANG is not specified then COBOL is the installation default for online compilation and AUTO is the default for batch compilation.
  • If a value of COBOL, HLASM, PL/1, or AUTO is specified (in the Compiler Language Selection panel or through the LANG parameter in a batch job) it overrides the default language.
AUTO
Automatically detect whether the copybook language is COBOL, PL/I, or Assembler and invoke the appropriate compiler. If the compilation results in a return code greater than the maximum allowed return code for that language, and no template can be produced, then the compilation error is reported. If File Manager successfully creates a template (despite the compilation errors), then it continues processing with the template.
COBOL
Invoke the COBOL compiler to create a template from the copybook. (Do not invoke the PL/I compiler, even if the COBOL compilation results in errors.)
PLI
Invoke the PL/I compiler to create a template from the copybook. (Do not invoke the COBOL compiler, even if the PL/I compilation results in errors.)
HLASM
Invoke the HLASM compiler to create a template from the copybook.
DSINFO

Specifies whether additional data set information for input and output sources should be produced in batch reports for the DSP, DSM, DSC, and FCH commands.

NO
No additional data set information is generated.
YES
Generates data set information including DSORG, RECFM, LRECL, BLKSIZE, and VSAM attributes including average record length, maximum record length, key offset, key length and reuse, for input and output data sets when applicable.
COBOL options
The following options are used to compile a COBOL copybook into a template:
DBCS=YES
Use the DBCS compiler option.
DBCS=NO
Use the NODBCS compiler option.

For details on the effect of the DBCS and NODBCS compiler options, see the IBM COBOL Programming Guide for OS/390 & VM .

CDPC=NO
Do not use the COBOL SPECIAL-NAMES paragraph "Decimal-point is comma".
CDPC = YES
Use the COBOL SPECIAL-NAMES paragraph "Decimal-point is comma".
CAE=NO
Do not use the COBOL compile option ARITH(EXTEND).
CAE = YES
Use the COBOL compile option ARITH(EXTEND).
MIXED = NO
Field names stored in the template in uppercase.
MIXED = NO
Field names stored in the template in uppercase.
MIXED = YES
Field names stored in the template in the original case as coded in the COBOL copybook.
RFROM1 RTO1 … RFROM5 RTO5
Up to five pairs of “From” and “To” pseudo-text character strings for the COBOL REPLACE compiler-directing statement.

If your COBOL copybooks contain characters that you want to remove or replace with other characters before compiling the copybooks into templates, then use these replacing options.

For example, if your copybooks contain colon characters (:) that you want to remove before compiling, then specify '==:==' as operand1 and '=====' as operand2.

For details on specifying “From” and “To” strings for COBOL REPLACE, see the IBM COBOL Language Reference.

CBLMAXRC
Sets the maximum acceptable return code for a copybook compile. A return code higher than the specified level causes the function to stop. Default is 4.
Note: The COMPMAXRC parameter is still supported but it is recommended that the CBLMAXRC parameter is used instead. If you do specify the COMPMAXRC parameter, it takes precedence over the language MAXRC.
CBLLIBS
Allows you to specify a list of up to ten data set names to be specified in the SYSLIB concatenation list. These data sets are searched in the order specified for COPY and INCLUDE members for the compilation.
dsname
The name of the data set name to be processed. Generic name masks are not allowed.
CBLADDOP
Additional COBOL compiler options which are included in a CBL statement when compiling COBOL copybooks.
PL/I options
The following options are used to compile a PL/I copybook into a template:
BIN63=YES
Use the LIMITS(FIXEDBIN(63)) compiler option.
BIN63=NO
Use the LIMITS(FIXEDBIN(31)) compiler option.
DEC31=YES
Use the LIMITS(FIXEDDEC(31)) compiler option.
DEC31=NO
Use the LIMITS(FIXEDDEC(15)) compiler option.
GRAPHIC=YES
Use the GRAPHIC compiler option.
GRAPHIC=NO
Use the NOGRAPHIC compiler option.
UNALIGNED=YES
Use the DEFAULT RANGE (*) UNALIGNED, language statement to change the default alignment.
UNALIGNED=NO
Use the PL/I default.
PLIMAXRC
Sets the maximum acceptable return code for a copybook compile. A return code higher than the specified level causes the function to stop. Default is 4.
Note: The COMPMAXRC parameter is still supported but it is recommended that the PLIMAXRC parameter is used instead. If you do specify the COMPMAXRC parameter, it takes precedence over the language MAXRC.
PLILIBS
Allows you to specify a list of up to ten data set names to be specified in the SYSLIB concatenation list. These data sets are searched in the order specified for COPY and INCLUDE members for the compilation.
dsname
The name of the data set name to be processed. Generic name masks are not allowed.
PLIADDOP
Additional PL/I compiler options which are included in a *PROCESS statement when compiling PL/I copybooks.

For details on the effect of these compiler options, see the IBM VisualAge PL/I for OS/390 Programming Guide.

HLASM options
The following options are used to compile a HLASM copybook into a template:
DBCS=YES
Use the DBCS compiler option.
DBCS=NO
Use the NODBCS compiler option.
NOALIGN=YES
Use the NOALIGN compiler option.
NOALIGN=NO
Use the ALIGN compiler option.
ASMMAXRC
Sets the maximum acceptable return code for a copybook compile. A return code higher than the specified level causes the function to stop. Default is 4.
Note: The COMPMAXRC parameter is still supported but it is recommended that the ASMMAXRC parameter is used instead. If you do specify the COMPMAXRC parameter, it takes precedence over the language MAXRC.
ASMLIBS
Allows you to specify a list of up to ten data set names to be specified in the SYSLIB concatenation list. These data sets are searched in the order specified for COPY and INCLUDE members for the compilation.
dsname
The name of the data set name to be processed. Generic name masks are not allowed.
ASMADDOP
Additional HLASM compiler options which are included in a *PROCESS statement when compiling COPY and MACRO members.

For details on the effect of these compiler options, see the HLASM V1R6 Programmer's Guide.

//DDIN  DD DSN=FMNUSER.COBOL2,DISP=SHR
//      DD DSN=FMNUSER.COBOL,DISP=SHR
//SYSIN DD *
$$FILEM BTB INPUT=DDIN,
$$FILEM MEMLIST=(DITTST1,
$$FILEM          DITTST3,
$$FILEM          DITTST7,
$$FILEM          XYZTST1),
$$FILEM LANG=COBOL,
$$FILEM COMPMAXRC=08,
$$FILEM RFROM1===:==,
$$FILEM RTO1=====,
$$FILEM REPLACE=YES,
$$FILEM DSNOUT=FMNUSER.TEMPLATE.NEW

Will produce the following output (if there is more than one input data set):

Report 1 Data set list

Data set name                                  Lib
---------------------------------------------------
FMNUSER.COBOL2                                   1
FMNUSER.COBOL                                    2


Build report

          Template Build Report
Copybook   Lib Template    Status
DITTST1      1 DITTST1     Replaced
DITTST3      1 DITTST3     Replaced
DITTST7      1 DITTST7     Compile error
XYZTST1      2 XYZTST1     Created

4 members read : Template : 1 Created  2 Replaced  1 Errors

The Lib column is displayed only when more than one input data set is found.