Normally REXX is used within a TSO/E environment and therefore it is logical to expect files to be allocated via the TSO/E ALLOC command or if executing in batch via a standard DD statement.

BPXWDYN provides an alternative which is used here for an existing file simply to demonstrate its use.

The use of BPXWDYN is potentially more relevant in other High Level Languages such as COBOL or PLI. In Assembler it may be easier to use that the Dynamic Allocation SVC.

If a file is allocated dynamically it is good practice to issue a FREE otherwise the file remains allocated until the session ends (LOGOFF).

File allocation using BPXWDYN





This method of file allocation is particularly useful if dynamic file allocation is required when executing under the control of IRXJCL, as the TSO ALLOC Command is not available to IRXJCL.

Copyright © Legac-e Education 2008-