Move a dataset that is in Linklist to a different volume

Sometimes we come across the need of moving to a different volume a dataset that is in Linklist.

We must remember that moving a dataset does not change the list of datasets defined to the current concatenation in any way – the dataset name remains the same -. The system will continue to use the current Linklist set as is and will not rebuild the concatenation.

To make a change to any dataset (ex: move) that is part of an active linklist set, you have to first remove it from the linklist set.  When it is no longer part of an active concatenation, then you can modify it as you like and then add it back in.

So, in order to move a Linklisted dataset to a different volume you would have to:

1. Define a new linklist set without the dataset you wish to recatalog.
2. Activate/implement it.
3. Move your dataset.
4. Define a linklist set with the dataset you’ve moved.
5. Activate/implement this new set.

Here’s an example of the commands you would use:

1. P LLA
2. SETPROG LNKLST,UNALLOCATE
3. Create a PROGT1 containing the LINKLIST members EXCEPT the one we want to move and rename LNKLST0x to LNKLST0x + 1
4. SET PROG=T1
5. SETPROG LNKLST,UPDATE,JOBNAME=*
6. Move the dataset into a different volume.
7. Create a PROGT2 containing the LINKLIST members INCLUDING the one we’ve moved to a different volume and increment the LNKLSTxx value (LNKLST0x + 1).
8. SET PROG=T2
9. S LLA,SUB=MSTR
10. SETPROG LNKLST,ALLOCATE
11. SETPROG LNKLST,UPDATE,JOBNAME=*

Here’s a practical example:

Current Linklist set: LNKLST00
Dataset name: SYS2.MOVE.EXAMPLE
Original volume: TST001
Destination volume: TST002
Current PROGxx: PROGT0

Commands:

  1. P LLA
  2. SETPROG LNKLST,UNALLOCATE
  3. Create a PROGT1 containing all the LINKLIST  datasets with the exception of SYS2.MOVE.EXAMPLE, and rename all instances of LNKLST00 to LNKLST01.
  4. SET PROG=T1
  5. SETPROG LNKLST,UPDATE,JOBNAME=*
  6. Move dataset SYS2.MOVE.EXAMPLE from volume TST001 to volume TST002.
  7. Create a PROGT2 containing all the LINKLIST datasets including SYS2.MOVE.EXAMPLES and rename all instances of LNKLST01 to LNKLST02.
  8. SET PROG=T2
  9. S LLA,SUB=MSTR
  10. SETPROG LNKLST,ALLOCATE
  11. SETPROG LNKLST,UPDATE,JOBNAME=*

Be the first to comment

Leave a Reply

Your email address will not be published.


*