Dynamic Allocation of PS Dataset Using a COBOL program.
Hi Mainframe, In most of Mainframe Shops, we use JCL for Allocation of PS Dataset. But Many a times a requirement comes where we need to allocates a PS dataset dynamically within a COBOL program which catalog the Files and once catalog the Allocated PS Dataset can be used to perform various File I/O operations such as Open, Read, Write and Close file. In order to Achieve these IBM has provide many Utility as such Sub program can be called in the COBOL main program as a Static call with the Appropriate TSO command to Allocate a new File Dynamically. Syntax for PS Data Set Allocations is: DSN(&SYSUID..MVS.TEST.FILE01) NEW TRACKS SPACE(100,100) UNIT(SYSDA) CATALOG The file name is Specified in the DSN and any number of Files can be Allocated using IBM Supplied Utility. The most come IBM Utility Used is: 'PUTENV' This Utility or Subprogram is called STATICALLY with the Above mention DSN details.... ID DIVISION . PROGRAM-ID . GETENVX. AUTHOR. S