CPYF (Copy File) syntax diagram
Job: B,I Pgm: B,I REXX: B,I Exec Threadsafe: Conditional; see Restrictions .-*LIBL/--------. >>-CPYF--FROMFILE(--+---------------+--file-name--)-------------> +-*CURLIB/------+ '-library-name/-' (1) >--TOFILE(--+-*PRINT-----------------------+--)-----------------> | .-*LIBL/--------. | '-+---------------+--file-name-' +-*CURLIB/------+ '-library-name/-' >--+---------------------------------------+--------------------> | .-*FIRST---------------. | '-FROMMBR(--+-*ALL-----------------+--)-' +-member-name----------+ '-generic*-member-name-' >--+----------------------------+-------------------------------> | .-*FIRST------. | '-TOMBR(--+-*FROMMBR----+--)-' '-member-name-' >--+-------------------------------+----------------------------> | (2) .-*NONE----. | '-MBROPT(-------+-*ADD-----+--)-' +-*REPLACE-+ '-*UPDADD--' (3) >--+----------------------------+-------------------------------> | (2) .-*NO--. | '-CRTFILE(-------+-*YES-+--)-' >--+-------------------------------------+----------------------> | .-*NONE----------------. | | | .------------------. | | | | V (4) | | | '-PRINT(--+---+-*EXCLD--+------+-+--)-' +-*COPIED-+ '-*ERROR--' >--+------------------------------------+-----------------------> | .-*ONLY--------------. | '-RCDFMT(--+-*ALL---------------+--)-' '-record-format-name-' >--+-----------------------------------------------------------------------------------+--> | .-*START-----------------. (5) .-*END-----------------. | +-FROMRCD(--+-starting-record-number-+--)--TORCD(-------+-ending-record-number-+--)-+ '-FROMKEY(--| FROMKEY Details |--)--TOKEY(--| TOKEY Details |--)--------------------' >--+-----------------------------------------+------------------> | (6) .-*END--------------. | '-NBRRCDS(-------+-number-of-records-+--)-' >--+-----------------------------------------------------------------------------------------+--> | .-*NONE------------------------------------------------------------------. | '-INCCHAR(--+-*RCD--field-name--+--------------------------------------------------+-+--)-' '-starting-position--+---------------------------+-' '-+-*EQ-+--character-string-' +-*LE-+ +-*GE-+ +-*GT-+ +-*LT-+ +-*NE-+ +-*NL-+ +-*NG-+ '-*CT-' >--+--------------------------------------------------------------------------------------------+--> | .-*NONE----------------------------------------------------------------------. | | | .------------------------------------------------------------------------. | | | | V (7) (8) (9) | | | '-INCREL(--+---(--+------+-------field-name--+--------------------------+-----------)-+-+--)-' +-*IF--+ '-+-*EQ-+--+-*NULL-------+-' +-*AND-+ +-*LE-+ '-field-value-' '-*OR--' +-*GE-+ +-*GT-+ +-*LT-+ +-*NE-+ +-*NL-+ '-*NG-' >--+------------------------------------------+-----------------> | .-*NONE--------------------. | '-FMTOPT(--+-*NOCHK-------------------+--)-' +-*CVTSRC------------------+ | .----------------------. | | V (10) | | '---+-*MAP-------+-------+-' +-*DROP------+ +-*CVTFLOAT--+ '-*NULLFLAGS-' >--+---------------------------------------+--------------------> | .-*SAME-----------------. | | | .-------------------. | | | | V (10) | | | '-SRCOPT(--+---+-*SEQNBR-+-------+-+--)-' '-*DATE---' >--+-----------------------------------------------------------+--> | (11) .-1.00-----------. .-1.00------------. | '-SRCSEQ(--------+-starting-value-+--+-increment-value-+--)-' >--+-----------------------+------------------------------------> | .-*CHAR-. | '-OUTFMT(--+-*HEX--+--)-' >--+----------------------------------+-------------------------> | .-0----------------. | '-ERRLVL(--+-*NOMAX-----------+--)-' '-number-of-errors-' >--+------------------------------+---------------------------->< | (12) .-*YES-. | '-COMPRESS(--------+-*NO(-+--)-' FROMKEY Details .-*NONE-------------------------------------. | (13) | |--+-number-of-key-fields--------'key-value'---+----------------| | .-------------------. | | V | (8) | '-*BLDKEY--(----'key-field-value'-+--)------' TOKEY Details .-*NONE-------------------------------------------. | (13) | (14) |--+-number-of-key-fields--'key-value'---------------+----------| | .-------------------------. | | V (13) | (8) | '-*BLDKEY--(----'key-field-value'-------+--)------'
Notes:
- If TOFILE(*PRINT) is specified, either *FIRST or *FROMMBR must be specified on theTOMBR parameter.
- If CRTFILE(*YES) is specified and the to-file does not exist, a library-name (not *LIBL) must be specified for the TOFILE parameter and MBROPT(*ADD) is assumed. If the to-file is an existing physical file, the MBROPT value must be either *ADD or *REPLACE.
- All parameters preceding this point can be specified in positional form.
- A maximum of 2 repetitions.
- If TORCD is specified, NBRRCDS cannot be specified.
- If NBRRCDS is specified, neither TORCD nor TOKEY can be specified.
- *IF can be specified the first time only; either *AND or *OR must be specified when repeating selections.
- A maximum of 50 repetitions.
- Only the operators *EQ and *NE are allowed if *NULL is specified.
- A maximum of 2 repetitions.
- When SRCSEQ is specified, SRCOPT is required.
- COMPRESS(*NO) is not allowed with TOFILE(*PRINT), and requires the default value for the INCCHAR and INCREL parameters. COMPRESS(*NO) is not allowed when copying from a delete capable file to a non-delete capable file.
- A maximum of 256 characters can be specifed.
- If TOKEY is specified, NBRRCDS cannot be specified.