I have a physical file called IIM that has three logical files attached to it: IIML01, IIML02, and IIML03. All of the files are in a library called BPCSF. I want to copy the physical file to a file called IIMOLD in the same library, attach duplicates of the logical files to it, and call them IIMOLD01, IIMOLD02, and IIMOLD03. This sounds like quite a task, but it's easy with PDM.
Here's how: Enter the Start PDM (STRPDM) command at a command line and select option 2 (Work with objects). Enter BPCSF as the library name, IIM* as the file name, *FILE for the object type, and *ALL for the attribute. The IIM file appears with all of its logical files. The Display Database Relations (DSPDBR) command confirms that the logical files are attached to the physical file. Now for the trick.
To copy IIM and all of its logical files to a work library (e.g., WORK), select the IIM file with option 3 and press F13 to duplicate the option to all of the logical files. When you press Enter, PDM prompts you for the name of the library to copy them to. Enter the name of your work library and press Enter. IIM and all dependent logical files are copied to your work library.
You should now change the library name at the top of the Work with Objects screen and press Enter. The new copy of the IIM file appears with a new set of logical files. Again, you can use the DSPDBR command on the new physical file to confirm that the logical files in the work library are attached to it.
At this point, you can rename IIM and all of its logical files to their new names. To do this, select the IIM file with option 7 and press F13 to duplicate the option to all of the logical files. When you press Enter, PDM prompts you for the new names of the files. Enter the names IIMOLD, IIMOLD01, IIMOLD02, and IIMOLD03, and press Enter. IIM and all dependent logical files are renamed in the work library.
You can move IIMOLD and its logical files back to the BPCSF library by using option 11 and pressing F13. When the system prompts you for the library you want to move the files to, enter BPCSF, press Enter, and you're done.
The technique I've just described will work only if the logical files are in the same library as the physical file. Also, it helps if you have a naming convention in which the logical files have the same prefix as the physical file they're attached to.
- Andre Nortje
LATEST COMMENTS
MC Press Online