UDM - cd (Change Directory) Command - zOS

cd (Change Directory) Command - zOS

The cd (Change Directory) command moves the current position within a file system. Position means different things depending on the file system.

This page describes the behavior of the cd command for each file system.

DSN (data set name) File System

The DSN (data set name) file system has no directories. The cd command treats each data set qualifier as a directory in regards to traversing and positioning within the data set name space.

UDM initializes the current directory to a high-level qualifier equal to the user identifier with which UDM executes.

A cd value can be enclosed in apostrophes ('). One or more qualifiers enclosed in apostrophes replaces the current directory value.

A cd value not enclosed in apostrophes is concatenated to the current directory value separated by a period (.), effectively moving up in the hierarchy.

There are two special directory (qualifier) names:

  1. Current directory - represented by a single period (.)
    Directory name . makes no change.
  2. Previous directory - represented by two periods (..).
    Directory name .. moves back one qualifier.

Examples

The following table provides examples of positioning within the data set file system using the cd command. The examples assume the following:

  • User ID of TOM123
  • UDM logical name SRV
     

Current Directory before cd

cd command

Current Directory after cd

TOM123

cd srv=data

TOM123.DATA

TOM123.DATA

cd srv=app1.jcl

TOM123.DATA.APP1.JCL

TOM123.DATA.APP1.JCL

cd srv=..

TOM123.DATA.APP1

TOM123.DATA.APP1

cd srv='GAM789.DATA'

GAM789.DATA

GAM789.DATA

cd srv=..

GAM789

GAM789

cd srv=..

GAM789

DD (ddname) File System

The DD (ddname) file system, like the DSN file system, has no directories. DD is the simplest form of file system in UDM.

A ddname is defined with a JCL DD statement. All the allocation attributes are specified with on the JCL DD statement.

UDM initializes the current directory to blanks in the DD file system.

A cd value specifies an allocated ddname to use as the current directory.