Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
1057887
1057887
(In all examples, CURLIB is the current library.)

  1. If the file specification contains only the file portion, the current library is pre-pended to the name to refer directly to a file with no member component.
    Example:
     

    <pre>
    COPY SRC=MYFILE
    </pre>
    Panel
    Html bobswift

    The absolute path derived would be CURLIB/MYFILE.
     

  2. If the file specification contains only file and member portions, the current library is pre-pended to the name to refer to a specific member in a file.

    Anchor
    1057892
    1057892
    Example:
     

    html-bobswift
    Panel
    <pre>
    COPY SRC=MYFILE(MYMBR)
    </pre>

    The absolute path derived would be CURLIB/MYFILE(MYMBR).
     

  3. If the file specification contains only library and file portions, an absolute path without a member component is used.

    Anchor
    1057895
    1057895
    Example:
     

    html-bobswift
    Panel
    <pre>
    COPY SRC=MYLIB/MYFILE
    </pre>

    The absolute path would be exactly as given: MYLIB/MYFILE.
     

  4. If a file specification contains library, file, and member portions, all of those components are used explicitly in the absolute path.

    Anchor
    1057898
    1057898
    Example:
     

    html-bobswift
    Panel
    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR)
    </pre>

    The absolute path would be MYLIB/MYFILE(MYMBR).

IBM i Destination File Specification Rules

...

Anchor
1057936
1057936
In these example, the current destination library is DSTLIB and the absolute path of the source file being copied is MYLIB/MYFILE(MYMBR).

  1. If the destination file specification contains an empty path (no library, file, or member portions), the file and member portions are derived from the source path. If the destination file is to be a save file, the absolute path in this case would be DSTLIB/MYFILE. If the destination file is to be a physical file, the absolute path would be DSTLIB/MYFILE(MYMBR).

    Anchor
    1057938
    1057938
    Examples:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR)
    </pre>


    The result is a destination name of DSTLIB/MYFILE(MYMBR) if the destination file type is a physical file.
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE
    </pre>


    The result is a destination name of DSTLIB/MYFILE if the destination file type is a save file.
     

  2. If the destination file specification contains only a file portion, the current library is pre-pended to the absolute path. In this case, if the destination file is to be a save file, the absolute path would be DSTLIB/YOURFILE. If the destination file is to be a physical file, the absolute path would be DSTLIB/YOURFILE(MYMBR).

    Anchor
    1057942
    1057942
    Examples:
     

    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOURFILE
    </pre>


    Panel


    Html bobswift

    The result is a destination name of DSTLIB/YOURFILE(MYMBR) if the destination file type is a physical file.
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE DST=YOURFILE
    </pre>


    The result is a destination name of DSTLIB/YOURFILE if the destination file type is a save file.
     

  3. If the destination file specification contains only a file portion (with an empty member), the result is exactly the same as when just a destination file name is given.

    Anchor
    1057946
    1057946
    Example:
     

    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOURFILE()
    </pre>


    Panel


    Html bobswift

    The result is a destination name of DSTLIB/YOURFILE(MYMBR) if the destination file type is a physical file.
     

  4. If the destination file specification contains only file and member portions, the resulting absolute path is DSTLIB/YOURFILE(YOURMBR) if a physical file is wanted.

    Anchor
    1057949
    1057949
    Example:
     

    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOUFILE(YOURMBR)
    </pre>


    Panel


    Html bobswift

    The result is a destination name of DSTLIB/YOURFILE(YOURMBR) if the destination file type is a physical file.
     

  5. If the destination file specification contains only a library portion, that library is used instead of the current library. In this case, an absolute path of YOURLIB/MYFILE is used if a save file is wanted. If a physical file is wanted, an absolute path of YOURLIB/MYFILE(MYMBR) is used.

    Anchor
    1057952
    1057952
    Examples:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOURLIB/
    </pre>


    The result is a destination name of YOURLIB/MYFILE(MYMBR) if the destination file type is a physical file.
     

    <pre>
    COPY SRC=MYLIB/MYFILE DST=YOURLIB
    / <
    /
    pre>


    Panel


    Html bobswift

    The result is a destination name of YOURLIB/MYFILE if the destination file type is a save file.
     

  6. If the destination file specification contains only library and file portions, an absolute path of YOURLIB/YOURFILE is derived if a save file is wanted. If a physical file is wanted, YOURLIB/YOURFILE(MYMBR) is used.

    Anchor
    1057956
    1057956
    Examples:
     

    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOURLIB/YOURFILE
    </pre>


    Panel


    Html bobswift

    The result is a destination name of YOURLIB/YOURFILE(MYMBR) if the destination file type is a physical file.
     

    <pre>
    COPY SRC=MYLIB/MYFILE DST=YOURLIB/YOURFILE
    </pre>


    Panel


    Html bobswift

    The result is a destination name of YOURLIB/YOURFILE if the destination file type is a save file.
     

  7. If the destination file specification contains library and file portions, as well as an empty member name, the result is exactly the same as when the file specification contains only library and file portions.

    Anchor
    1057960
    1057960
    Example:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR) DST=YOURLIB/YOURFILE()
    </pre>


    The result is a destination name of YOURLIB/YOURFILE(MYMBR) if the destination file type is a physical file.
     

  8. If the destination file specification contains a complete absolute path (library, file, and member portions), the source file name has no effect on the destination path in any way. In this case, if the destination file type is a save file, YOURLIB/YOURFILE is used. If the destination file type is a physical file, YOURLIB/YOURFILE(YOURMBR) is used.

    Anchor
    1057963
    1057963
    Examples:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE(MYMBR)DST=YOURLIB/YOURFILE(YOURMBR)
    </pre>


    The result is a destination name of YOURLIB/YOURFILE(YOURMBR) if the destination file type is a physical file.
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYLIB/MYFILE DST=YOURLIB/YOURFILE
    </pre>


    The result is a destination name of YOURLIB/YOURFILE if the destination file type is a save file.
     

  9. In cases where a member is specified explicitly in the destination file name and the destination file type is a save file, an error is issued.
     

    Note
    titleNote

    If the user issues a cd dst-logical-name=.. command to blank out the current library on the destination side, the library name in the absolute path of the source file is used in the destination absolute path in cases where no library is specified explicitly.

     

    Anchor
    1057968
    1057968
    This works only for IBM i to IBM i copies where both operating systems are operating in the LIB file system.
    Anchor
    1057969
    1057969
    Example:
     

    html-bobswift
    Panel


    <pre>
    CD DST=..
    COPY SRC=MYLIB/MYFILE(MYMBR)
    </pre>


    The result is a destination of MYLIB/MYFILE(MYMBR), using the source's library, file, and member names, because none are supplied explicitly in the copy command. The current directory on the destination side is empty because the command cd DST=.. was issued.

Destination (only) in LIB File System

...

Anchor
1058007
1058007
(In the following example, the source file being copied is MYFILE and the current library on the destination side is MYDSTLIB.)

  1. If the destination file specification contains an empty path (no library, file, or member portions), the source file name is used for the file and member names on the destination side. If the destination file is to be a save file, the absolute path in this case would be DSTLIB/MYFILE. If the destination file is to be a physical file, the absolute path would be DSTLIB/MYFILE(MYFILE).

    Anchor
    1058009
    1058009
    Example:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYFILE
    </pre>


    DSTLIB/MYFILE(MYFILE) will be used as the destination name if the destination file type is a physical file and DSTLIB/MYFILE will be used if the destination file type is a save file.
     

  2. If the destination file specification contains only a file portion, the current library is pre-pended to the absolute path and the source file name is used for the member (if it applies). In this case, if the destination file is to be a save file, the absolute path would be DSTLIB/YOURFILE. If the destination file is to be a physical file, the absolute path would be DSTLIB/YOURFILE(MYFILE).

    Anchor
    1058012
    1058012
    Example:
     

    <pre>
    COPY SRC=MYFILE DST=YOURFILE
    </pre>


    Panel


    Html bobswift

    DSTLIB/YOURFILE(MYFILE) will be used as the destination name if the destination file type is a physical file and DSTLIB/YOURFILE will be used if the destination file type is a save file.
     

  3. If the destination file specification contains only a file portion and an empty member portion, the result is exactly the same as when the file specification contains only file portion.

    Anchor
    1058015
    1058015
    Example:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYFILE DST=YOURFILE()
    </pre>


    DSTLIB/YOURFILE(MYFILE) will be used as the destination name if the destination file type is a physical file.
     

  4. If the destination file specification contains only file and member portions, the resulting absolute path is DSTLIB/YOURFILE(YOURMBR) if a physical file is wanted.

    Anchor
    1058018
    1058018
    Example:
     

    <pre>
    COPY SRC=MYFILE DST=YOURFILE(YOURMBR)
    </pre>


    Panel


    Html bobswift

    DSTLIB/YOURFILE(YOURMBR) will be used as the destination name if the destination file type is a physical file.
     

  5. If the destination file specification contains only a library portion, that library is used instead of the current library. In this case, an absolute path of YOURLIB/MYFILE is used if a save file is wanted. If a physical file is wanted, an absolute path of YOURLIB/MYFILE(MYFILE) is used.

    Anchor
    1058021
    1058021
    Example:
     

    <pre>
    COPY SRC=MYFILE DST=YOURLIB
    / <
    /
    pre>


    Panel


    Html bobswift

    YOURLIB/MYFILE(MYFILE) is used as the destination name if the destination file type is a physical file or YOURLIB/MYFILE if the destination file type is a save file.
     

  6. If the destination file specification contains only library and file portions, an absolute path of YOURLIB/YOURFILE is derived if a save file is wanted. If an absolute path of YOURLIB/YOURFILE(MYFILE) is used if a physical file is wanted,

    Anchor
    1058024
    1058024
    Example:
     

    html-bobswift
    Panel


    <pre>
    COPY SRC=MYFILE DST=YOURLIB/YOURFILE
    </pre>


    YOURLIB/YOURFILE(MYFILE) is the destination name if a physical file is wanted and YOURLIB/YOURFILE is used if a save file is wanted.
     

  7. If the destination file specification contains library and file portions, as well as an empty member portion, the result is exactly the same as when the specification contains only a library and file portions.

    Anchor
    1058027
    1058027
    Example:
     

    <pre>
    COPY SRC=MYFILE DST=YOURLIB/YOURFILE
    </pre>


    Panel


    Html bobswift

    YOURLIB/YOURFILE(MYFILE) is the destination name if a physical file is wanted.
     

  8. If the destination file specification contains a complete absolute path (library, file, and member portions), the source file name has no effect on the destination path in any way. In this case, if the destination file type is a physical file, YOURLIB/YOURFILE(YOURMBR) is used.

    Anchor
    1058030
    1058030
    Example:
     

    <pre>
    COPY SRC=MYFILE DST=YOURLIB/YOURFILE(YOURMBR)
    </pre>


    Panel


    Html bobswift

    YOURLIB/YOURFILE(YOURMBR) is the destination if the destination file type is a physical file.
     

  9. In cases where a member is specified explicitly in the destination file name and the destination file type is a save file, an error is issued.