Example 3: Moving a zone to another CSI data set

Assume that you need to move a zone from one CSI data set to another. You can do this with the ZONEEXPORT (described in The ZONEEXPORT command) and ZONEIMPORT commands. First, you export the zone to a sequential data set. In the process of exporting the zone, you also delete the zone and its zone index by specifying PURGE(INDEX). Next, you define a new zone index pointing to the new CSI data set and then import the zone.

The following SMP/E commands move a zone from one CSI data set to another CSI data set:
SET        BDY (MVSTZ)      /* Set to zone to export.   */.
ZONEEXPORT (MVSTZ)          /* Export zone MVSTZ.       */
           OUTFILE(EXPORT1) /* DD statement for output. */
           PURGE(INDEX)     /* Delete zone MVSTZ        */
                            /* and its zone index.      */.

SET        BDY(GLOBAL)      /* Set to global zone.      */.
UCLIN                       /* Define new zone index.   */.
ADD        GZONE            /*                          */
           ZINDEX(          /*                          */
                  (MVSTZ,SMP.IMPORT.CSI,TARGET)     /*  */
                 )          /*                          */
                            /*                          */.
ENDUCL                      /*                          */.
SET        BDY(MVSTZ)       /* Set to new zone.         */.
ZONEIMPORT (MVSTZ)          /* Import zone MVSTZ        */
           INFILE(EXPORT1)  /* from specified DD        */
           INTO(MVSTZ)      /* into target zone MVSTZ.  */.

After the ZONEEXPORT and ZONEIMPORT operations, you have moved zone MVSTZ into SMP.IMPORT.CSI.