DYNAM Command

In this section:

How to:

The FOCUS DYNAM command is used to manipulate data sets under z/OS. Although similar functions are available under TSO, the DYNAM command is very useful in non-TSO environments when TSO is not necessarily present. DYNAM is recommended instead of TSO commands to manipulate data sets.

Syntax: How to Manipulate Data Sets Under z/OS

DYNAM subcommand operand [operand]... 

where:

subcommand

Required. Is one of the following operations:

ALLOCATE
ALLOC
ALLO

Allocates a z/OS MVS data set or z/OS USS file. A wide variety of allocation options is supported.

CONCAT
CONC

Concatenates data sets.

FREE

Frees data sets specified by ddnames or dsnames. Each name may contain wildcard characters.

CLOSE
CLO

Closes data sets. Useful when the data sets cannot be freed because they are open. The command has the same syntax as DYNAM FREE above.

COPY

Copies an entire data set or selected PDS members. The command has powerful features such as record format conversion, either automatic or controlled by options.

COPYDD

Copies data between z/OS data sets and/or HiperFOCUS files. DYNAM COPY has been enhanced to handle all functions offered by COPYDD, and is recommended for use instead of COPYDD.

DELETE
DEL 

Deletes an entire data set or selected PDS members.

RENAME
REN 

Renames an entire data set or selected PDS members.

SUBMIT
SUB

Submits z/OS jobs.

COMPRESS
COMP

Compresses partitioned data sets (PDSs).

SET TEMP

Allocates temporary files.

operand

May be a keyword, a keyword followed by its parameter, or a parameter without a keyword.

The following rules apply to the DYNAM command:

  • The subcommand name, keywords, and parameters are separated with one or more blanks. Keywords are coded in free format.
  • A parameter may be a list of subparameters (for example, VOLUME for a multi-volume data set). Subparameters in the list should be separated with commas. For blanks between subparameters (with or without the comma), enclose the entire list in parentheses. For example:
    A,B (A,B) (A B) (A, B) (A,B C, D)
  • DYNAM commands may span several lines. To do so, enter a hyphen (-) at the end of each line to be continued. In concatenating the lines, blanks after the hyphen and leading blanks from the next line are removed. Blanks before the hyphen are removed if they are preceded with a comma. The total length of a DYNAM command may not exceed 2048 characters.
  • Most keywords may be truncated up to the shortest unambiguous length. The commonly used abbreviations are fixed. It is important to note that the unique truncation of a keyword may not always be valid as new keywords are added. Using the full keyword in files and using truncations interactively is recommended.
  • Fixed abbreviations are listed in the following syntax descriptions. For example, DDNAME may be abbreviated as DD, DDN, DDNA, DDNAM, or DDNAME.
  • Certain keywords have synonyms. For example, the keywords FILENAME and DDNAME are synonyms, and so are DATASET and DSNAME.
  • As in TSO, a data set name can be enclosed in single quotation marks. Prefix substitution is not supported; only the fully qualified data set names should be specified.
  • Some DYNAM commands accept either the ddname or data set name (dsname) as the same parameter. In such cases, the parameter is considered a ddname if it is not longer than 8 bytes, does not contain periods (.), and is not enclosed in single quotation marks. Otherwise, the parameter is considered a data set name. Thus, to specify an unqualified data set name, enclose it in single quotation marks.
  • Dialogue Manager variables can be used in a DYNAM command, in which case the variable value is substituted at run time. If a variable is used as part of a data set name, it may need to be followed by extra period characters (.) in order to be substituted correctly. For example, in the following DYNAM command, three periods are required. The first period ends the variable name. If there were only a second period, it would be considered an indexed variable, and no period would be inserted in the string. The third period indicates that one period should be inserted into the string after the variable name:
    -SET &OUT_NAME = CAR ;
    DYNAM ALLOC F CAR DA USER1.&OUT_NAME...FOCUS SHR REU

    The resulting string is:

    DYNAM ALLOC F CAR DA USER1.CAR.FOCUS SHR REU

The DYNAM command and its subcommands, except for COMPRESS and CLOSE, are available from the DYNAM Utilities Menu. Additional allocations for the menu are not required. Private applications may be included on the primary menu. To access the menu, enter the command:

EX DYMENU

Use of Data Sets

z/OS obtains a lock for any allocated data set name: a shared lock for those specified as SHR; an exclusive lock for OLD, NEW, or MOD.

Although data sets can be allocated more than once in a job step, only one type of lock may be obtained. For example, if the data set is allocated as SHR and is then allocated as OLD in the same step, the z/OS lock changes from shared to exclusive, and the data set will not be available for use by other jobs until all allocations in this job are freed.

In addition, a z/OS exclusive lock is not sufficient in multi-user environments, such as FOCUS MSO. If one user were to allocate a data set as OLD, z/OS would allow another user to allocate it as OLD also, because both requests occur in the same job step. This can cause data set corruption due to simultaneous updating.

In order to alleviate these issues, the DYNAM commands that manipulate data sets use an improved locking mechanism, similar to that implemented in ISPF:

ALLOCATE Subcommand

How to:

The DYNAM ALLOCATE command allocates a data set.

Syntax: How to Allocate a z/OS MVS Data Set With the ALLOCATE Subcommand

DYNAM ALLOCATE normal_disp [CLOSE]
DDNAME ddname [DEFER] [LONGNAME lnam] [DSNAME dsname{(memname)|(n)} 
[DUMMY]
[EXPDT date]
[HIPER OFF]
[DALDKYL labelname]
[INPT|OUTPT]
[LABEL type]
[MEMBER memname] status [MSVGP msvgp]
[PARALLEL] [PASSWORD password] [PERM] [POSITION nnnn]
[REFVOL dsname] [RETPD days] [REUSE]
[UNIT unit [UCOUNT n]]
[VOLUME volser]

Space operands are:

space_format
space_alloc
 [DIR n]
 [PRIMARY n1]
 [RELEASE] [ROUND]
 [SECONDARY n2] [SPACE space]

DCB operands are:

 [BLKSIZE n] [BUFNO n]
 [DEN n] [DSORG dsorg]
 [LRECL n]
 [EATTR {NO|OPT}]
 [RECFM recfm] [REFDD ddname] [REFDSN dsname]

SMS and VSAM operands are:

 [DATACLASS name] [DSNTYPE {LIBRARY|PDS|EXTREQ|EXTPREF}]
 [KEYOFF n]
 [LIKE dsname]
 [MGMTCLASS name]
 [RECORG recorg]
 [SECMODEL name] [STORCLASS name]
 [BUFND m]
 [BUFNI n]

Output printing operands are:

 [DEST dest[.user]]
 [FCB name [ALIGN|VERIFY]] [FORMS name] 
 [HOLD]
 [OUTLIM n] [OUTPUT name]
 [SYSOUT class]
 [USER user]
 [WRITER name]

where:

ALLOCATE

Can be abbreviated as ALLOC or ALLO.

normal_disp

Can be one of the following:

CATALOG 
DELETE 
KEEP 
UNCATALOG 
UNCAT

Data set normal disposition. By default, for a data set status of NEW, if dsname is specified, the disposition is CATALOG. Otherwise, the disposition is DELETE. Incompatible with SYSOUT. Synonyms are: CATALOG-CATLG.

CLOSE

Deallocation of the data set at close rather than at the end of the step. JCL analogy: FREE=CLOSE.

DDNAME ddname DDDEFER

DDNAME to be associated with an allocation. Must be specified. Synonyms are: DDname-Filename. Assign device(s) to the data set but defer mounting of the volume(s) until the data set is opened. JCL analogy: DEFER in UNIT.

DSNAME dsname [(memname)]

Member name can be specified either in parentheses after dsname or using keyword MEMBER (see below). If dsname is specified as asterisk (*), terminal is allocated. This is used for output only. Synonyms are: DSname-DAtaset.

[(n)]

Relative GDG number.

DUMMY

Dummy data set is to be allocated.

DALDKYL labelname

Specifies the label for the encryption key used by the system to encrypt the data set. The maximum length of the label is 64 characters. The TSO ALLOC equivalent is DSKEYLBL.

For example, to allocate a DD with pervasive encryption, key MYLABELNAME:

DYNAM ALLOC DD ASDF .... DALDKYL MYLABELNAME ... SHR

This keyword has an effect only when creating an extended format data set. the first value for the DISP keyword must be coded or defaulted.

EXPDT date

Expiration date in format YYDDD, YYYY/DDD, or YYYYDDD. Incompatible with RETPD and SYSOUT.

HIPER OFF

Prohibit allocation in a hiperspace. Equivalent to the "UNIT NOHIPER" and is used when UNIT is to be specified too. For example, "UNIT VIO HIPER OFF".

INPT OUTPT

Data set is to be processed as input only (INPT) or output only (OUTPUT). JCL analogy: IN in LABEL. Incompatible with SYSOUT.

LABEL type

Type of volume labels. Can be one of the following: NL, SL, NSL, SUL, BLP, LTM, AL, or AUL. Incompatible with SYSOUT.

LONGNAME lnam

Is a Master File name longer than eight characters. Creates a copy of the corresponding short Master File in the PDS allocated to DD HOLDMAST. For more information, see the Describing Data manual.

MEMBER memname

Name of a PDS member to be allocated. See also DSNAME.

status

Data set status. Default: NEW. Incompatible with SYSOUT. Can be one of the following: MOD, NEW, OLD, SHR

MSVGP msvgp

Identification of a group of mass storage system (MSS) virtual volumes. Incompatible with SYSOUT and VOLUME.

PARALLEL

Each volume is to be mounted on a separate device. JCL analogy: P in UNIT.

PASSWORD password

Password for a password protected data set.

PERM

The allocation is to be permanent—that is, protected from being freed or concatenated by any DYNAM command issued by an MSO user. The operand is valid only in an MSO server initialization profile.

POSITION nnnn

Data set sequence number on a tape volume, up to 9999. JCL analogy: the first subparameter in LABEL.

REFVOL dsname

Volume serial information is to be obtained from the specified cataloged data set. JCL analogy: VOL=REF=dsname. Incompatible with SYSOUT and VOLUME.

RETPD days

Retention period, up to 9999 days. Incompatible with EXPDT and SYSOUT.

REU[SE]

If the ddname to be allocated is already in use, it is to be freed.

UNIT unit

Device group name, device type, specific unit address, or NOHIPER. NOHIPER prohibits allocation in a hiperspace, meaningful for a temporary (NEW,DELETE) data set; see also HIPER OFF.

UCOUNT n

Number of volumes to allocate.

VOLUME volser VOL

Volume serial numbers. Incompatible with REFVOL and SYSOUT. Synonyms are: VOLume-VOLser.

Space operands may be:

space_format

Can be one of the following:

ALX 
CONTIG 
MXIG

Format of the primary space to be allocated: up to five contiguous areas (ALX); one contiguous area (CONTIG); one maximal contiguous area (MXIG). JCL analogy: ALX/CONTIG/MXIG in SPACE.

space_alloc
Can be one of the following:
BLOCKS [n]
CYLINDERS 
MEGABYTES 
PAGES 
TRACKS

N represents units of primary and secondary space allocation. If parameter for BLOCKS is omitted, the average block length is copied from BLKSIZE. If space unit is omitted but SPACE and BLKSIZE are specified, BLOCKS equal BLKSIZE is used. For PAGES, BLOCKS 4096 is used. BLKSIZE must be specified if the BLOCKS parameter is specified. Synonyms are: CYLINDERS-CYLs, TRACKS-TRKs.

DIR n

Number of 256-byte records for the directory of a PDS.

PRIMARY n1

Primary space quantity. See also SPACE.

RELEASE

Unused space is to be released when the data set is closed. Synonyms are: RELEASE-RLSE.

ROUND

If space is requested in BLOCKS, MEGABYTES, or PAGES, it is to be rounded to whole cylinder(s).

SECONDARY n2

Secondary space quantity. See also SPACE.

SPACE space
SP

Primary (n1) and/or secondary (n2) space quantity in one of the following formats:

n1/(n1)/n1,n2/(n1,n2)/n1 n2/(n1 n2)/,n2/(,n2)

See also PRIMARY and SECONDARY.

DCB operands may be:

BLKSIZE n

Block size, up to 32760. See also BLOCKS.

BUFNO n

Number of buffers, up to 255.

DEN n

n represents magnetic tape density: 0, 1, 2, 3, or 4 for 200, 556, 800, 1600, 6250 bpi respectively.

DSORG dsorg

Data set organization. Default, for NEW only; PO if DIR or DSNTYPE specified; PS otherwise. The following values are syntactically correct:

VS VSAM.

PO/POU PDS or PDS unmovable.

DA/DAU direct access or direct access unmovable.

PS/PSU physical sequential or physical sequential unmovable.

LRECL n

Logical record length, up to 32760.

EATTR {NO|OPT}

Specifies if the data set to be created on a DASD volume can have extended attributes and reside in the extended address space (cylinder-managed space on the volume beyond the 64k cylinder limit). Valid values are:

  • NO. Data set to be created is not allowed to have extended attributes. it must not be created in the extended address space. This is the default value.
  • OPT. Data set to be created allows extended attributes to be stored in a 'FORMAT 8/9 DSCB' on the volume. The data set is allowed to be created in the extended address space. For example:
    DYNAM ALLOC DD EAV DSN hlq.EAV.DATA NEW DSORG PS RECFM FB LRECL 80 CYL EATTR OPT
RECFM recfm

Record format. The first letter should be D, F, U, or V, which may be followed by any valid combination of A, B, M, S, or T:

A records with ISO/ANSI control characters.

B blocked records.

D variable-length ISO/ANSI tape records.

F fixed-length records.

M records with machine code control characters.

S standard fixed-length or spanned variable-length records.

T track overflow.

U undefined-length records.

V variable-length records.

REFDD ddname

DCB attributes are to be copied from the specified ddname. Under TSO, EXPDT and INPT/OUTPT specifications are also copied. Any of those can be overridden by appropriate keyword on the same command. JCL analogy: DCB=*.ddname. Incompatible with REFDSN.

REFDSN dsname

DCB attributes (DSORG, RECFM, OPTCD, BLKSIZE, LRECL, RKP, KEYLEN) and EXPDT are to be copied from the specified cataloged data set. Any of those can be overridden by appropriate keyword on the same command. JCL analogy: DCB=dsname. Incompatible with REFDD.

SMS and VSAM operands are:

DATACLASS name

Name of a data class for an SMS managed data set.

DSNTYPE {LIBRARY|PDS|EXTREQ|EXTPREF}

LIBRARY is for a new partitioned extended (PDSE), and PDS is for a new partitioned data set. A PDSE cannot contain load modules, should be SMS-managed, and allows concurrent updating of different members.

EXTREQ specifies that a data set must be extended format (required). It may be VSAM or sequential.

EXTPREF requests that the data set be extended format (preferred). If the system cannot create it in extended format, it will try basic format. It may be VSAM or sequential.

KEYOFF n

Offset of the key in each logical record for a new VSAM key-sequenced (RECORG KS) data set.

LIKE dsname

Allocation attributes (DSORG, RECORG or RECFM, LRECL, KEYLEN, KEYOFF, SPace, DIR) are to be copied from the specified cataloged data set (model). Any of those can be overridden by appropriate keyword on the same command.

MGMTCLASS name

Name of a management class for an SMS managed data set.

RECORG recorg

VSAM record organization: KS, ES, RR, or LS for key-sequenced, entry-sequenced, relative record, or linear space data set respectively.

SECMODEL name

Data set RACF profile is to be copied from the named existing RACF profile.

STORCLASS name

Name of a storage class for an SMS managed data set.

BUFND m

Is the number of VSAM DATA buffers.

BUFNI n

Is the number of VSAM INDEX buffers.

Output printing operands may be:

DEST dest[.user]

Remote destination for a SYSOUT data set. In conjunction with user ID, it is a node and a user at that node; the user ID can be coded after the period (.) or using the USER keyword (see below).

FCB name [ALIGN|VERIFY]

Name of an FCB (forms control buffer) image to be used for printing of a data set. The operator may be asked to check the printer forms alignment (ALIGN), or to verify the FCB image name displayed on the printer (VERIFY).

FORMS name FORM

A SYSOUT form name. JCL analogy: third subparameter in SYSOUT, FORMS in OUTPUT JCL.

HOLD

A SYSOUT data set is to be placed on the hold queue.

OUTLIM n

Limit for the number of logical records in a SYSOUT data set.

OUTPUT name

Name(s) of OUTPUT JCL statement(s) to be associated with a SYSOUT data set.

SYSOUT class

A SYSOUT data set is to be allocated and the specified output class (A-Z, 0-9) is to be assigned. If asterisk (*) or NULL is coded, the class is copied either from CLASS in OUTPUT JCL if it is specified, or from MSGCLASS in JOB otherwise.

USER user

A SYSOUT data set is to be routed to the specified user ID. DEST (see above) is required to specify a user's node.

WRITER name

Name of an installation written system output printing routine. JCL analogy: second subparameter in SYSOUT. Incompatible with USER.

In addition to the shown fixed abbreviations and synonyms, keywords may be abbreviated up to the unique truncation. Those abbreviations are not fixed and may be changed when new keywords are added. They may be used interactively to save some keystrokes, but when a command is saved in a file, using unabbreviated keywords is recommended.

Example: Using the DYNAM ALLOCATE Command

Allocate an existing data set:

DYNAM ALLOC DD MYDD DS MYID.DATA.SET SHR REU

Allocate a new data set. Defaults: NEW, CATALOG (DSname present), DSORG PO (not-zero DIR present):

DYNAM ALLOC DD MYDD DS MYID.DATA.SET SPACE 6,2 TRACKS DIR 4 UNIT SYSDA -
RECFM FB LRECL 80 BLKSIZE 1600

Allocate a terminal:

DYNAM ALLOC DD MYDD DS *

Allocate a SYSOUT data set with default output class. Upon freeing, the data set is sent to the user ID U1234 at node SYSVM:

DYNAM ALLOC DD MYDD SYSOUT * DEST SYSVM.U1234

Syntax: How to Allocate a z/OS USS File With the ALLOCATE Subcommand

DYNAM ALLOCATE DDNAME ddname PATHNAME path REUSE -
    RECFM VB LRECL lrecl [other_operands]

where:

ddname

Is the logical name to be associated with the allocation.

path

Identifies a UNIX file.

A pathname begins with a slash (/). The system treats any consecutive slashes as a single slash. The pathname can be 2 to 250 characters long, including the initial slash.

A pathname consists of the names of the directories from the root to the file being identified, and the name of the file, including the extension. The pathname is case sensitive. The form is:

 /name1/name2/.../fname.ext

For example:

/u/user1/hcar1.mas 

The pathname consists of printable characters from X'40' to X'FE'. A filename can contain characters outside this range,but these characters cannot be specified in the JCL. Enclose the pathname in single quotation marks if it contains any character other than the following characters:

  • Uppercase letters.
  • Numeric digits.
  • Special characters (#, $, or @).
  • Slash (/).
  • Asterisk (*).
  • Plus sign (+).
  • Hyphen (-).
  • Period (.).
  • Ampersand (&).

Note: Allocation verifies the validity of the pathname. However, there is no ENQ or locking of the pathname, so it is possible to modify a pathname component, even in an asynchronous process. Doing this may cause errors in OPEN or unexpected results, with no errors reported.

REUSE

Specifies that the file name being allocated is to be freed and reallocated if it is currently in use.

RECFM VB

Identifies the record format. For a USS file, the record format is VB.

LRECL lrecl

Defines the record length. The record length must be at least as large as the longest input line.

The following operands are supported with PATHNAME:

  • BLKSIZE
  • BUFNO
  • DSNTYPE
  • DUMMY
  • FILEDATA
  • LRECL
  • NCP
  • PATHDISP
  • PATHMODE
  • PATHOPTS
  • RECFM
  • REUSE
  • TERM

The syntax for the optional supported operands follows.

BLKSIZE n

Block size, up to 32760.

BUFNO n

Number of buffers, up to 255.

DSNTYPE {HFS|PIPE}

HFS specifies a UNIX file system.

PIPE specifies a first-in first-out (FIFO) special file, which is also called a named pipe.

DUMMY

Dummy data set is to be allocated.

FILEDATA(content_type)

Controls the data conversion method, performed by the network file system client, when accessing network files on a different system. The other system might be OS/390®, AIX®, or certain other kinds of systems. The FILEDATA keyword is used to describe the content type of a z/OS UNIX file so that the system can determine how to process the file. Valid content types are:

  • BINARY. Specifies that the file described by the DYNAM command is a byte-stream file and does not contain record delimiters. The access method does not insert or delete record delimiters.

    If you do not code the FILEDATA operand, the system assigns a default value of BINARY to the UNIX file.

  • TEXT. Specifies that the file described by the DYNAM command contains records delimited by the EBCDIC newline character (x'15').

    See the appropriate DFSMS/MVS publications for more details about the Network File System client and its conversion methods.

    You need to code the PATH operand together with the FILEDATA operand.

    You can code the FILEDATA operand together with the following ALLOCATE operands: BLKSIZE, BUFNO, DSNTYPE, DUMMY, LRECL, NCP, PATHDISP, PATHMODE, PATHOPTS, RECFM.

  • RECORD. Indicates that the data consists of records with prefixes. The record prefix contains the length of the record that follows. On output, the access method inserts a record prefix at the beginning of each record. On input, the access method uses the record prefix to determine the length of each record. The access method does not return the prefix as part of the record. Code FILEDATA(RECORD) when you cannot code FILEDATA(TEXT) because your data might contain bytes that are considered delimiters.

    Note: The record prefix for FILEDATA(RECORD) is mapped by the IGGRPFX macro. This is different from the record descriptor word (RDW) that is in z/OS physical sequential format-V data sets.

NCP(number_of_channel_programs)

Specifies the maximum number of READ or WRITE macro instructions allowed before a CHECK or WAIT macro instruction is issued. The maximum number must not exceed 255 and must be less than 255 if the address space does not have enough virtual storage. If you are using chained scheduling, you must specify an NCP value greater than 1. If you omit the NCP operand, the default value is 1.

PATHDISP([normal_disposition] [, abnormal_disposition])

Specifies the disposition of a UNIX file upon normal and abnormal (conditional) TSO/E session termination. Valid values are the same for both:

  • KEEP. Specifies that the file should be kept. This is the default values.
  • DELETE. Specifies that the file should be deleted.
PATHMODE(file_access_attribute)

Specifies the file access attributes when the PATHOPTS operand also specifies OCREAT.

If you specify either OCREAT alone, or OCREAT and OEXCL, in the PATHOPTS operand, and if the file does not exist, MVS performs an open() function. The options from PATHOPTS, the pathname from the PATHNAME operand, and the options from PATHMODE (if specified) are used in the open(). MVS uses the close() function to close the file before the application program receives control.

For status group options other than OCREAT and OEXCL, it is assumed that the application or OPEN macro passes the operands to the open() function without modification. That is, this application or OPEN macro uses dynamic allocation information retrieval (the DYNALLOC macro) to retrieve the subparameters specified for PATHOPTS, and passes the subparameters to the open() function. The application program can ignore or modify the information specified in the JCL or on the ALLOCATE command.

You can specify up to 14 file access attributes. Separate each with a comma. The system treats duplicate specifications as a single specification. Subparameter Definition:

SIRUSR

Specifies permission for the file owner to read the file.

SIWUSR

Specifies permission for the file owner to write the file.

SIXUSR

Specifies permission for the file owner to search, if the file is a directory, or to execute, for any other file.

SIRWXU

Specifies permission for the file owner to read, write, and search, if the file is a directory, or to read, write, and execute, for any other file.

This value is the bit inclusive OR of SIRUSR, SIWUSR, and SIXUSR.

SIRGRP

Specifies permission for users in the file group class to read the file.

SIWGRP

Specifies permission for users in the file group class to write the file.

SIXGRP

Specifies permission for users in the file group class to search, if the file is a directory, or to execute, for any other file.

SIRWXG

Specifies permission for users in the file group class to read, write, and search, if the file is a directory, or to read, write, and execute, for any other file.

This value is the bit inclusive OR of SIRGRP, SIWGRP, and SIXGRP.

SIROTH

Specifies permission for the users in the file other class to read the file.

SIWOTH

Specifies permission for the users in the file other class to write the file.

SIXOTH

Specifies permission for users in the file other class to search, if the file is a directory, or to execute, for any other file.

SIRWXO

Specifies permission for users in the file other class to read, write, and search, if the file is a directory, or to read, write, and execute, for any other file.

This value is the bit inclusive OR of SIROTH, SIWOTH, and SIXOTH.

SISUID

Specifies that the system set the user ID of the process to be the same as the user ID of the file owner when the file is run as a program.

SISGID

Specifies that the system set the group ID of the process to be the same as the group ID of the file owner when the file is run as a program. The group ID is taken from the directory in which the file resides.

When creating a new UNIX file, if you do not code a PATHMODE operand on a DYNAM command with a PATHNAME operand, the system sets the permissions to zero, which prevents access by all users. If the UNIX file already exists, PATHMODE is checked for syntax, but ignored. The permission bits are left as they are set.

PATHOPTS(file_options)

Specifies the file access and status used when accessing a file specified in the PATHNAME operand. You can specify up to seven file options. Separate each with a comma. The system treats duplicate specifications as a single specification.

Access Group Options

Specify only one of the following options.

Note: If you specify more than one Access Group, the system ignores them and uses ORDWR.

  • ORDONLY. Specifies that the program can open the file for reading.
  • OWRONLY. Specifies that the program can open the file for writing.
  • ORDWR. Specifies that the program can open the file for reading and writing. Do not use this option for a FIFO special file.
Status Group Options

You can specify up to 6 of these options.

For status group options other than OCREAT and OEXCL, the description in this book assumes that the application or OPEN macro passes the operands to the open() function without modification. That is, this application or OPEN macro uses dynamic allocation information retrieval (the DYNALLOC macro) to retrieve the subparameters specified for PATHOPTS and passes the subparameters to the open() function. The application program can ignore or modify the information specified in the JCL or on the ALLOCATE command.

  • ORDONLY. Specifies that the program can open the file for reading.

  • OWRONLY. Specifies that the program can open the file for writing.
  • ORDWR. Specifies that the program can open the file for reading and writing. Do not use this option for a FIFO special file.
  • OAPPEND. Specifies that the system sets the file offset to the end of the file before each write, so that data is written at the end of the existing file.
  • OCREAT. Specifies that the system is to create the file. If the file already exists, the operation fails if OEXCL is specified, and opens the existing file if OEXCL is not specified.
  • OEXCL. Specifies that, if the file does not exist, the system is to create it. If the file already exists, open() fails. Note that the system ignores OEXCL if OCREAT is not also specified.
  • ONOCTTY. Specifies that, if the PATHNAME operand identifies a terminal device, open() does not also make the terminal device the controlling terminal of the process and the session.
  • ONONBLOCK. Specifies the following, depending on the type of file:
    • For a FIFO special file with ORDONLY option set, ONONBLOCK specifies read-only opening of the file. If ONONBLOCK is not specified, the read-only open() blocks until a process opens the file for writing.
    • For a FIFO special file with OWRONLY option set, ONONBLOCK specifies that the system immediately process a request for a write-only open() of the file, if a process has already opened the file for reading. If the file is not open for reading, the system returns an error. If ONONBLOCK is not specified, the write-only open() blocks until a process opens the file for reading.
    • For a character special file that supports a nonblocking open(), ONONBLOCK specifies that the system immediately returns if it cannot open a file because the device is not ready or available. If ONONBLOCK is not specified, the open() blocks until the device is ready or available.

      Specifications of ONONBLOCK has no effect on other file types.

  • OSYNC. Specifies that the system is to move data from buffer storage to permanent storage before returning control from a callable service that performs a write.
  • OTRUNC. Specifies that the system is to truncate the file to zero length if all of the following conditions are true:
    • The file specified on the PATH operand exists.
    • The file is a regular file.
    • The file successfully opened with ORDWR or OWRONLY.

    The system does not change the mode and owner. OTRUNC has no effect on FIFO special files or directories.

TERM

Indicates to the system that a data set is coming from or going to a terminal for a TSO/E user.

CONCAT Subcommand

How to:

The DYNAM CONCAT command concatenates up to 16 data sets.

Syntax: How to Concatenate Data Sets

DYNAM CONCAT [PERM] DDNAME ddname1 ddname2 [ddname3...]

where:

CONCAT

Can be abbreviated as CONC.

PERM

Optional. Marks the concatenation as permanent—that is, protected from being freed or concatenated again by any DYNAM command issued by an MSO user. Valid only in an MSO server initialization profile.

DNAME
DDN
DD

Required. Synonym is FILENAME.

ddname1

Is the first ddname to be concatenated and associated with the resulting concatenated group.

ddname2

Is the second and any subsequent ddname to be concatenated.

Example: Using the DYNAM CONCAT Command

DYNAM CONCAT DDN FOCEXEC MYEX NEWEX

FREE Subcommand

How to:

The DYNAM FREE command deallocates any number of specified data sets.

Syntax: How to Deallocate Data Sets

DYNAM FREE {DDNAME ddname [ddname...]|DSNAME dsname [dsname...]}
DYNAM FREE LONGNAME lnam

where:

DDNAME
DDN
DD

Is required if there is no dsname. Synonym is FILENAME.

ddname

Is the ddname of the data set to be freed.

DSNAME
DSN
DS

Is required if there is no ddname. Synonym is DATASET.

dsname

Is the name of the data set to be freed. All ddnames associated with this dsname, except concatenated groups, are deallocated.

lnam

Is a Master File name longer than eight characters. For more information, see the Describing Data manual.

While at least one ddname or data set name is required, you may specify more than one ddname or data set name. Each specified name may contain asterisks (*) and question marks (?) as wildcards. Wildcards are special characters used to specify a subset of names rather than one name. The wildcards can appear anywhere in a name and mean the following:

*

Represents any number of characters. For example, "*Q*" matches any name containing the character "Q".

?

Represents any single character. For example, "?Q?" matches any 3-character name containing the character "Q" in the middle.

If the ddname is not found, an error message is issued only if a single ddname without wildcards is specified. An error message is not displayed if a data set or more than one ddname is not found.

Example: Using the DYNAM FREE Command

DYNAM FREE DDN SYS0* TEMP?
DYNAM FREE DSN MYID.DATA.SET

CLOSE Subcommand

How to:

The DYNAM CLOSE command closes data sets, which cannot be freed because they are open.

Syntax: How to Close Data Sets

DYNAM CLOSE {DDNAME ddname [ddname...]|DSNAME dsname [dsname...]}

where:

CLOSE

Can be abbreviated as CLO.

DDNAME
DDN
DD

Is required if there is no dsname. Synonym is FILENAME.

ddname

Is the ddname of the data set to be closed.

DSNAME
DSN
DS

Is required if there is no ddname. Synonym is DATASET.

dsname

Is the name of the data set to be closed. All ddnames associated with this dsname, except concatenated groups, are closed.

While at least one ddname or data set name is required, more than one ddname or data set name may be specified. Each specified name may contain wildcard characters. The same rules apply to the DYNAM CLOSE command as for the DYNAM FREE command (see FREE Subcommand).

COPY Subcommand

How to:

The DYNAM COPY command copies an entire z/OS data set or selected PDS members.

Syntax: How to Copy Entire z/OS Data Sets or Selected PDS Members

DYNAM COPY dname1 {[TO] dname2 [[MEMBER] members]|[MEMBER] members}
 [options]

where:

dname1

Is the dsname or ddname of the input data set. This is a positional parameter. It must precede all other operands.

TO

May be omitted if dname2 does not match a reserved word, the MEMBER keyword, an option, or the TO keyword. To avoid confusion, use the TO keyword whenever dname2 is a ddname.

dname2

Is the dsname or ddname of the output data set. If the output data set is not a PDS and the dsname is specified, it will be allocated as OLD. If the ddname is specified, and the status is SHR, you must make sure that other users do not access the data set during COPY. Unlike ISPF, DYNAM will lock a non-PDS data set in order to prevent simultaneous updating by different DYNAM users.

MEMBER

May be omitted if members are specified in parentheses.

members

Can be a single member specification or a list of member specifications. If the members are enclosed in parenthesis, blanks preceding the left parenthesis may be omitted.

options

May be one or more of the following options:

APPEND 

Adds the input to the end of the existing data, if the output is a sequential data set.

FORCE 

Copies input DCB attributes (RECFM, BLKSIZE, LRECL and KEYLEN) to the output data set. By default, only missing values are assigned.

Note: Do not use FORCE to change the LRECL of one member of an existing PDS as doing so may potentially destroy the PDS.

KEYMOD 

Allows key modification according to input/output KEYLEN: truncation or padding with binary zeros.

REPLACE 

Replaces all output members matching the selected member names.

TRUNCATE 

Allows truncation of input records that are longer than the output record length. Since trailing blanks are truncated automatically when RECFM is different, the keyword is used either to cut records of the same format or to cut non-blank data.

A member specification has the following syntax

mem[,[newmem][,REPLACE]]

where:

mem

Is the selected member name.

newmem

Is the optional new name for the output member.

REPLACE

Is optional and specifies an existing member to be replaced in the output PDS.

Since the comma may be used in member specifications, they are separated with one or more blanks when specified in a list. Therefore, a list of member specifications is always enclosed in parentheses. For example:

(MEM MEM,NEWMEM MEM,NEWMEM,R MEM,,R)

Note:

  • All conversions between different DCB attributes (RECFM, BLKSIZE, and LRECL) are performed automatically.
  • If the entire PDS is copied or any selected member's directory entry contains a TTRN in user data (for example, a load module), the IBM utility IEBCOPY is invoked. In this case, all options except REPLACE are ignored, format conversion is not possible, and copying members to the same PDS is not supported. Note that IEBCOPY requires APF authorization in order to be performed.
  • If the main member and its alias names are copied, their relationship remains the same on the output PDS. Aliases are not supported for members of HiperFOCUS files.
  • If a specified ddname has been allocated with a member name, the data set is treated as sequential. However, if input and/or output is a HiperFOCUS file, member name(s) overriding the allocated one can be specified in the command.
  • If the entire PDS is to be copied (no member list was provided), all members are replaced, regardless of the presence or absence of the REPLACE keyword.

Example: Using the DYNAM COPY Command

Copies the entire data set, whether it is a PDS or not.

DYNAM COPY MYDD MYID.DATA.SET

All four commands are equivalent. Either input or output may be a sequential data set, or both are PDSs.

DYNAM COPY MYDD MYID.DATA.SET MEMBER MEM
DYNAM COPY MYDD MYID.DATA.SET(MEM)
DYNAM COPY MYDD(MEM) MYID.DATA.SET
DYNAM COPY MYDD MEMBER MEM MYID.DATA.SET

Copies and renames one member.

DYNAM COPY MYID.DATA.LIB TO MYDD(MEM1,MEM2)

Copies two members.

DYNAM COPY MYID.DATA.LIB TO MYDD(MEM1 MEM2)

Copies two members into same PDS with renaming.

DYNAM COPY MYDD(OLD1,NEW1,R OLD2,NEW2)
DYNAM COPY MYDD(OLD1,NEW1 OLD2,NEW2) REPL

COPYDD Subcommand

How to:

The DYNAM COPYDD command copies a sequential data set, a PDS member, or a HiperFOCUS file.

Syntax: How to Copy Sequential Data Sets, PDS Members, or HiperFOCUS Files

DYNAM COPYDD ddname1[(mem1)] ddname2[(mem2)]

where:

ddname1

Is the ddname of the input data set.

mem1

Optional. Is the input member name.

ddname2

Is the ddname of the output data set.

mem2

Optional. Is the output member name.

Note:

  • If the specified ddname has been allocated with a member name, the data set is treated as sequential. However, if input and/or output is a HiperFOCUS file, a member name overriding the allocated one can be specified in the command.
  • Identically named members are always replaced on the output PDS.
  • All conversions between different DCB attributes (RECFM, BLKSIZE, and LRECL) are performed automatically.
  • Since the DYNAM COPY command has been upgraded to work with HiperFOCUS files and has more features than COPYDD, using COPY instead of COPYDD is recommended.

Example: Using the DYNAM COPYDD Command

MYDD1 is a sequential file or is allocated with a member name. If MYDD2 is allocated with a member name, MEM2 is valid only if at least one of the ddnames is a HiperFOCUS file.

DYNAM COPYDD MYDD1 MYDD2(MEM2)

DELETE Subcommand

How to:

The DYNAM DELETE command deletes an entire z/OS data set or selected PDS members.

Syntax: How to Delete an Entire z/OS Data Set or Selected PDS Members

The syntax to delete an entire z/OS data set is:

DYNAM DELETE dsname

To delete individual members use:

DYNAM DELETE dname [MEMBER] members

where:

DELETE

Can be abbreviated as DEL.

dsname

Is the data set name to be deleted and uncataloged.

dname

Is the dsname or ddname of a PDS containing one or more members to be deleted. The ISPF-like lock is obtained.

MEMBER

May be omitted if the members are specified in parentheses.

members

Can be a single member name or a list of members. If the members are enclosed in parentheses, blanks before the left parenthesis can be omitted.

Example: Using the DYNAM DELETE Command

DYNAM DELETE MYID.DATA.OLD
DYNAM DEL MYID.DATA.LIB MEMBER OLD1,OLD2
DYNAM DELETE MYDD(OLD1,OLD2)
DYNAM DEL MYDD(OLD1 OLD2 OLD3)

RENAME Subcommand

How to:

The DYNAM RENAME command renames an entire z/OS data set or selected PDS members.

Syntax: How to Rename an Entire z/OS Data Set or Selected PDS Members

The syntax to rename an entire z/OS data set is:

DYNAM RENAME dsname1 dsname2

To rename individual members, use

DYNAM RENAME dname [MEMBER] members [REPLACE]

where:

RENAME

Can be abbreviated as REN.

dsname1

Is the data set name to be renamed and uncataloged.

dsname2

Is the new name to be assigned to the data set and cataloged.

dname

Is the dsname or ddname of a PDS containing one or more members to be renamed. The ISPF-like lock is obtained.

MEMBER

May be omitted if the members are specified in parentheses.

members

Can be a single member specification or a list of members. If the members are enclosed in parentheses, blanks before the left parenthesis can be omitted.

REPLACE

Optional. Replaces all members matching the specified new names.

A member specification has the following syntax:

oldmem,newmem[,REPLACE]

where:

oldmem

Is the original member name.

newmem

Is the new member name.

REPLACE

Is optional and replaces existing members with the same name as newmem.

Since the comma is used in member specifications, each pair of members is separated with one or more blanks when specified in a list. Therefore, a list of member specifications is always enclosed in parentheses.

Example: Using the DYNAM RENAME Command

DYNAM RENAME MYID.DATA.OLD MYID.DATA.NEW
DYNAM REN MYID.DATA.LIB MEMBER OLD,NEW,R
DYNAM RENAME MYDD(OLD1,NEW1,R OLD2,NEW2)
DYNAM REN MYDD(OLD1,NEW1 OLD2,NEW2) REPL

SUBMIT Subcommand

How to:

The DYNAM SUBMIT command submits jobs to z/OS.

Syntax: How to Submit a Job to z/OS

DYNAM SUBMIT dname [[MEMBER] members]

where:

SUBMIT

Can be abbreviated as SUB.

dname

Is the dsname or ddname of the input data set(s) containing JCL to be submitted. The ddname can specify a concatenation of data sets.

MEMBER

May be omitted if the members are specified in parentheses.

members

May be a single member name or a list of members. When submitting a member list, the resulting job stream is the concatenation of the members. If the members are enclosed in parentheses, blanks before the left parenthesis can be omitted.

Example: Using the DYNAM SUBMIT Command

DYNAM SUBMIT MYDD MEMBER ASM,PROG,LKED
DYNAM SUB MYDD(ASM,PROG,LKED)
DYNAM SUB MYID.DATA.LIB(CREATE LOAD)
DYNAM SUBMIT MYFILE

Note: The DYNAM SUBMIT command provides an interface with the submit user exit IKJEFF10 as described in the IBM TSO Extensions Version 2 Customization manual. For details, see the Information Builders Technical Memo 7859, Enabling a Site-Specified Submit Exit Routine, or view FOCCTL.DATA(SUBMITZ2).

COMPRESS Subcommand

How to:

The DYNAM COMPRESS command compresses the partitioned data sets (PDS).

Syntax: How to Compress a Partitioned Data Set

DYNAM COMPRESS dname [dname]...

where:

COMPRESS

Can be abbreviated as COMP.

dname

Is the dsname or ddname of a PDS to be compressed. The ISPF-like lock is obtained.

If the dsname is specified, it is allocated as OLD. If the ddname is specified and status is SHR, you have to make sure that another user does not access the PDS during the compress operation.

Note: DYNAM COMPRESS uses the IBM utility IEBCOPY, and therefore can only be used when running with APF authorization.

Example: Using the DYNAM COMPRESS Command

DYNAM COMPRESS MYDD
DYNAM COMPRESS MYID.DATA.LIB
DYNAM COMP MYDD MYID.DATA.LIB

Comparison of TSO Commands, JCL, and DYNAM

This section shows examples of TSO ALLOCATE and FREE commands, JCL commands, and the equivalent DYNAM commands.

Example: Allocating an Existing File

TSO:

 TSO ALLOC F(FOCEXEC) DA('MYUSER.FOCEXEC.DATA') SHR

 

JCL:

//FOCEXEC DD DSN=MYUSER.FOCEXEC.DATA,DISP=SHR

 

DYNAM:

 DYNAM ALLOC FILE FOCEXEC DA MYUSER.FOCEXEC.DATA SHR

Example: Creating a New Data Set

TSO:

TSO ALLOC F(FOCEXEC) DA('MYUSER.FOCEXEC.DATA') -
    SPACE(5,3) TRACKS CATALOG DIR(2) -
    UNIT(SYSDA) USING(NEWDCB) -
    LRECL(80) RECFM(F B) BLKSIZE(1600)

 

JCL:

//FOCEXEC DD DSN=MYUSER.FOCEXEC.DATA,DISP=(NEW,CATLG),
//   SPACE=(TRK,(5,3,2)),UNIT=SYSDA,
//   DCB=(LRECL=80,RECFM=FB,BLKSIZE=1600)

 

DYNAM:

DYNAM ALLOC FILE FOCEXEC DA MYUSER.FOCEXEC.DATA -
      SPACE 5,3 TRACKS CATLG DIR 2 UNIT SYSDA - 
      LRECL 80 RECFM FB BLKSIZE 1600

Example: Freeing Files

TSO:

TSO FREE F(FOCEXEC)

 

DYNAM:

DYNAM FREE FILE FOCEXEC

Example: Concatenating Files

TSO:

TSO ALLOC F(FOCEXEC) DA('MYUSER.FOCEXEC.DATA'-
    'MYUSER.PROGRAMS.DATA') SHR

 

JCL:

//FOCEXEC DD DSN=MYUSER.FOCEXEC.DATA,DISP=SHR
//   DD DSN=MYUSER.PROGRAMS.DATA,DISP=SHR

 

DYNAM:

DYNAM ALLOC FILE FOCEXEC DA MYUSER.FOCEXEC.DATA SHR
DYNAM ALLOC FILE PROGRAMS DA MYUSER.PROGRAMS.DATA SHR
DYNAM CONCAT FILE FOCEXEC PROGRAMS

Allocating Temporary Files

How to:

Temporary files are transient files that disappear after you end a session.

You can control the size and location of temporary metadata files and data files created by HOLD commands. You can specify that the temporary files reside in the hierarchical file system, MVS data sets, or in hiperspace.

Syntax: How to Allocate Temporary Files

DYNAM SET TEMP[ALLOC] {MVS|HIPER}

where:

MVS

Allocates temporary files to MVS data sets. This is the default value.

HIPER

Allocates temporary files to hiperspace.

Note: For z/OS, temporary metadata files can be allocated using a similar procedure to allocating permanent metadata files:

  • If DYNAM allocation for HOLDMAST or HOLDACC is present, temporary files are stored in the designated PDSs.
  • If DYNAM SET TEMP[ALLOC] MVS is issued, temporary files are stored in the default temporary PDSs.
  • If DYNAM SET TEMP[ALLOC] HIPER is issued, temporary files are stored in HIPERSPACE.

Syntax: How to Allocate Temporary Files to MVS Data Sets

To alter the default allocation parameters for temporary files for MVS data sets, issue the following command.

DYNAM SET TEMP[ALLOC] FOR type dynam_parms

where:

type

Is one of the following: HOLDACC, HOLDMAST, HOLD SAVE, REBUILD, FOCUS, FOCSORT, OFFLINE, or FOC$HOLD.

dynam_parms

Are regular DYNAM ALLOC parameters to be used as default for that type. Note that DCB parameters, if provided here, will be ignored, since they must be compatible with the file type being written.

This is similar to the functionality of IBITABLA. The defaults should be overwritten for all cases when a private copy of IBITABLA exists containing different values.

System defaults for HOLDMAST and HOLDACC are:

TRKS 5 5 DSORG PO DIR 36 NEW REU

System defaults for all other types are:

CYLS 5 10 DSORG PS NEW REU

Example: Allocating HOLD Masters

The following command allocates HOLD Master Files to a data set named USER1.HOLDMAST.DATA

DYNAM SET TEMP FOR HOLDMAST DA USER1.HOLDMAST.DATA SHR REU

Information Builders