Dynamically Allocate Datacom VSAM Transparency Files
Learn how to dynamically allocate Datacom VSAM Transparency files.
Datacom VSAM Transparency
provides support for dynamic allocation of Datacom VSAM Transparency
files. Dynamic allocation is useful when you want an application program to determine, at execution time, the files required for the program's successful execution. For example, if different files are required (depending on program input, parameters, or other variables) for different executions of the program, the program can invoke SVC 99 to dynamically allocate only those files required for the current execution. Similarly, a batch TSO program can dynamically allocate the files needed to complete a particular task.Dynamic allocation support provided by
Datacom VSAM Transparency
is as follows:
- SVC 99 Text Keys supported include the following:
- VERB 01 (Allocate):
- Text Key: '0001' DALDDNAM Specify the DDNAME to be allocated.
- Text Key: '005F' DALSSNM Specify the name ofDatacom VSAM TransparencySubsystem.
- Text Key: '0060' DALSSPRM Specify theDatacom VSAM TransparencySubsystem parametersVUTNM=and (optionally)DDNAME=.
- Text Key: '0052' DALPERMA Specify the permanent allocation attribute.
- Any batch job that issues dynamic allocation (SVC 99) requests forDatacom VSAM Transparencyfiles must also provide a DD statement for the DDNAME DV$DYNBR as follows:
DD Statement: Dynamic Allocation for Batch Jobs
►►─ //DV$DYNBR DD SUBSYS=(aaaa,'DYNAMNBR=nn') ────────────────────►◄
- aaaa
- Is the name of theDatacom VSAM TransparencySubsystem.
- DYNAMNBR=
- Denotes the maximum number of dynamic allocation requests allowable for the current job (this is the only allowableSUBSYS= subparameter for this DD statement).TSO users who subsequently execute programs requesting dynamic allocation ofDatacom VSAM Transparencyfiles must specify the DV$DYNBR DD statement (as shown above) in the TSO LOGON procedure invoked when they log on to TSO (theDatacom VSAM TransparencySubsystem, shown as aaaa above, must be activated before LOGON, or the LOGON attempt will fail). Specify a value for DYNAMNBR= that denotes the maximum number of concurrentDatacom VSAM Transparencydynamic allocation requests for the current session. If the number of concurrent dynamically-allocatedDatacom VSAM Transparencyfiles reaches this limit, any subsequent dynamic allocation requests forDatacom VSAM Transparencyfiles will be rejected.
Dynamic Allocation Subroutine (DVV99PR)
A dynamic allocation subroutine is provided by
Datacom VSAM Transparency
to assist you in implementing dynamic allocation. Its use is optional (though recommended) for batch users of dynamic allocation.The DVV99PR subroutine can be called by an application program when it detects the need for a file that is not currently allocated. The call to DVV99PR must pass a single parameter, structured in the following manner:
DD Statement: Dynamic Allocation Subroutine
►►─ 'DDname,ssnm,VUTNM=vutnm,DDNAME=optddnm' ─────────────────────►◄
- ddname
- Specifies the DDNAME to be allocated.
- ssnm
- Specifies theDatacom VSAM TransparencySubsystem name.
- vutnm
- Specifies the name of the VIT to be used.
- optddnm
- Specifies the name of an override DDNAME in the VIT (see the description ofDDNAME=in Example of DDNAME Substitution).
Example
When DVV99PR is invoked by using a TSO CLIST, the format of the call is as follows (in this example, the ddname referenced in the program is PERKSDS, the
Datacom VSAM Transparency
Subsystem name is CAVT, and the VIT to be used is DVVUTPR):
TSOEXEC CALL 'vsamt.LOADLIB(DVV99PR)' + 'PERKSDS,CAVT,'VUTNM=DVVUTPR,DDNAME=PERKSDS'
The
DDNAME=
reference above is shown only for syntax reference; it does not actually name a different DDNAME.Batch Invocation of DVV99PR
If DVV99PR is invoked from a batch program, the total length of the parameter string must be specified in a 2-byte binary field at the beginning of the string. The following example shows how DVV99PR might be called from a COBOL program to dynamically allocate four files that will be required for processing during program execution.
The dynamic allocations must be accomplished before issuing OPENs for the files.
WORKING-STORAGE SECTION. ... ... ... 01 DYNALLOC-WORKAREA. 05 DYNALLOC-LENGTH PIC 9(2) COMP VALUE 25. 05 DYNALLOC-DDNAME PIC X(6) VALUE SPACE. 05 FILLER PIC X VALUE ','. 05 DYNALLOC-SUBSYS PIC X(4) VALUE 'CAVT'. 05 FILLER PIC X VALUE ','. 05 DYNALLOC-VUTNM PIC X(13) VALUE 'VUTNM=DVVUTPR'. ... ... ... * PROCEDURE DIVISION. ... ... ... MOVE 'MASTER' TO DYNALLOC-DDNAME. PERFORM Z9000-CALL-DYNALLOC. MOVE 'CUSTMR' TO DYNALLOC-DDNAME. PERFORM Z9000-CALL-DYNALLOC. MOVE 'DETAIL' TO DYNALLOC-DDNAME. PERFORM Z9000-CALL-DYNALLOC. MOVE 'ORDERS' TO DYNALLOC-DDNAME. PERFORM Z9000-CALL-DYNALLOC. ... ... ... Z9000-CALL-DYNALLOC. CALL 'DVV99PR' USING DYNALLOC-WORKAREA. *