Previous Topic Next topic Print topic


Controlling where Datasets are Created

To override the default location used during the creation of datasets, you can configure Enterprise Server to consult a file containing rules that determine where new datasets are created.

You do this by setting the ES_ALLOC_OVERRIDE environment variable to the location of the "rules" file. Each rule in the file specifies: an offset from the beginning of the catalog record, a value that will be found at the offset in records for datasets that match the rule, and a directory in which the files for those datasets will be created.

For example, the following rule:

OFFSET(n) VALUE (MYSTRING) SUBDIR (C:\MYDIR\MYSUBDIR)

will allocate to C:\MYDIR\MYSUBDIR all files that contain the string "MYSTRING" at position n of the catalog record. The catalog structure is defined in the copyfile: mvscatlg.cpy. This is located in %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\base\source .

Each rule must occupy only 1 line and all keywords must be in uppercase. Rules are processed in the order that they appear in the file, and the first one that matches is the one that is used; that is, no further rules are consulted for that dataset.

Example rules file

#  Key off of the spool indicator
OFFSET(313) VALUE(S) SUBDIR(C:\MVSP0030\SPOOL)
#  Key off of the VOLUME value.
OFFSET(314) VALUE(CSIWRK) SUBDIR(C:\MVSP0030\VOLUME) 
#  Key off of the DSORG
OFFSET(324) VALUE(VSAM) SUBDIR(C:\MVSP0030\VSAM)
#  Key off of the LRECL
OFFSET(469) HEXVALUE(0063) SUBDIR(C:\MVSP0030\LRECL99)
#  Key off of the first 6 bytes of the dataset name
OFFSET(1) VALUE(MFIDMF) SUBDIR(C:\MVSP0030\MFIDMF) 
#  Key off of the DATACLAS value.
OFFSET(449) VALUE(MFIDMFY) SUBDIR(C:\MVSP0030\DATACLAS) 
Note:
  • If you want your catalogs to be portable it is a good practice to have the "Subdir" directories at the same level in the directory structure or in directories that are children of the directory containing the catalog.dat file. In the example below we recommend that the catalog.dat be located in C:\MVSP0030\ This is not an absolute requirement, but will help your maintenance.
  • When you are specifying the name of the subdirectory to which files should be allocated, you can specify the string <CatalogFolder> to indicate the directory in which the catalog is stored. For example:
    OFFSET(313) VALUE(S) SUBDIR(<CatalogFolder>\SPOOL)
  • You can also use environment variables when specifying the subdirectory to which files should be allocated. For example:
    OFFSET(313) VALUE(S) SUBDIR($APPROOT\SPOOL)
    where APPROOT is the environment variable. The environment variable will be expanded before it is used in the pc dataset name field in the system catalog.
Previous Topic Next topic Print topic