Joined: 28 Aug 2007 Posts: 1685 Location: Tiruppur, India
We have two load module libraries, old and new.
I need to copy some load modules from old to new and their corresponding aliases.
When I go to the PDS via ISPF and issue a "C" infront of only an alias member(only the alias member and not the corresponding data member),
it copies both the alias and corresponding member and the TTR values match.
However if I use a IEBCOPY batch job to copy the alias, it does not copy the data member.
If I copy both alias and data member using IEBCOPY, then the TTR does not match :-(
Joined: 06 Jun 2008 Posts: 8518 Location: Dubuque, Iowa, USA
The system is doing what you asked. From the DFSMSdfp Utilities manual on IEBCOPY with emphasis added by me:
Copying Members That Have Alias Names (COPY Statement)
This topic discusses using the COPY statement for copying a PDS, PDSU, or PDSE that has members with alias names. The COPYGRP or COPYGROUP statement is recommended for copying program objects.
Tip: If the COPY statement is used to copy program objects, errors can occur.
If you are copying an entire data set to a new data set (one that has no members before the copy operation), all members and their aliases will be copied, and they will have the same relationship to one another as they had on the original data set.
If you are merging a data set with another data set, no members or aliases on the output data set will be changed unless you specify that input members are to replace output members.
In all instances, if you have a member A with alias B on your input data set, and a member C with alias B on your output data set, if you do not indicate replacement, member A will be copied over, but the alias name B will continue to refer to C. If you do indicate replacement, B will be copied as an alias of member A in the newly merged data set.
When selectively copying from a partitioned data set, you must specify every name that you want copied, including their aliases.
There is another type of alias on z/OS which is also handled differently, and that is an alias of a member of a loadlib. Tests using LOADLIBs with aliases showed that both IEBCOPY and XCOM will copy over aliases for load modules only when the entire loadlib is transferred. No alias relationship is maintained when transferring or copying over individual modules. MVS does not maintain the TTR's integrity when an individual module is relinked or copied or transferred. This is much the same as with source/text/listing members.
An alias transfer can only work if its associated base module is also transferred. This is due to the fact that the TTR pointer to the base member will be different on the receiving side. If the base member doesn't exist on the receiving side, there's no way to get a valid TTR pointer to place in the ALIAS directory entry.
So you need to either copy the entire load library or don't expect aliases to be associated with their base in the target load library if members are copied.