MOVEFILE
Authorization
General User
Purpose
Use the MOVEFILE command to move data from any device supported by z/VM to any other device supported by z/VM.
Operands
- inddname
- is the ddname representing the input file definition. If ddname is not specified, the default input ddname, INMOVE, is used.
- outddname
- is the ddname representing the output file definition. If ddname is not specified, the default output ddname, OUTMOVE, is used.
Options
- PDS
- moves each of the members of the CMS MACLIB or TXTLIB or of an OS partitioned data set into a separate CMS file. Each CMS file has a file name equal to the member name and a file type equal to the file type of the output file definition.
Usage Notes
- If the input to MOVEFILE is a printer file spooled to the user's reader, the carriage control characters will not be available if the CC option was specified on the PRINT command which created the file. They will also not be available if the print file was created by an application program that uses carriage control characters.
- Use the FILEDEF command to provide file definitions for the ddnames used in the MOVEFILE
command. If you use the ddnames INMOVE and OUTMOVE on the FILEDEF commands, you need not specify
them on the MOVEFILE command line. For example:
copies the member STOW from the OS partitioned data set SYS1.MACLIB into the CMS file STOW MACRO.filedef inmove disk sys1 maclib b (member stow filedef outmove disk stow macro movefileIf you enter:
a file is moved from your virtual reader to your virtual printer.filedef indd reader filedef outdd printer movefile indd outddThe file being moved is the next file in your virtual reader. The next file is the one for which the RDR command returns information. Which file this is depends on the class of the reader, the class of the files in the reader, and whether they are held. You can make a specific reader file the next file by ORDERing the reader prior to issuing the MOVEFILE command.
- To copy an entire OS partitioned data set into individual CMS files, you could enter:
These commands copy members from the OS partitioned data set SYS1.MACLIB or the CMS file SYS1 MACLIB into separate files, each with a file name equal to the member name and a file type of MACRO.filedef test2 disk sys1 maclib b filedef macro disk movefile test2 macro (pdsNote: The output ddname was not specified in full, so that CMS assigned the default file definition (FILE ddname). - You cannot copy VSAM data sets with the MOVEFILE command.
- You can use the MOVEFILE command to move data contained in spanned records. If your FILEDEF command specifies the record format as DS, DBS, VS, or VBS, the logical record interface (LRI) will be used.
- When using MOVEFILE on a file with spanned record formats, the default LRECL is 32756, and the record area is 32756+32.
- MOVEFILE handles record format defaults for ANSI tapes in this manner:
- On input, if RECFM is not specified or RECFM is specified as U or V, record format D is used.
- On output, the record format of the input file is used. However, if you are writing to a non-ANSI tape or other devices and the input file's record format is D, record format V is used. If you are writing to an ANSI tape and the input file's record format is V, record format D is used.
- To copy an entire partitioned data set into another partitioned data set, use the COPYFILE
command. If an attempt is made to use MOVEFILE without the PDS option for a partitioned data set,
only the first member is copied and an end of file condition results. The resultant output file will
contain all input records, including the header, until the end of the first member. Note: If MOVEFILE is used without the PDS option for a TXTLIB or a MACLIB, it will be treated as a partitioned data set.
- If you use the MOVEFILE command and FILEDEF command with the options DISP MOD and RECFM FB to add a file to the end of an existing OS simulated file, the user should erase the end of file mark at the end of the existing file. The end of file mark will be present only if the last physical record written was a short block. In addition, during multivolume tape processing, DISP MOD is only valid with the tape currently mounted; no volume switching will be done.
- The following record formats are supported for DOS files on FBA devices: fixed, fixed blocked, variable, variable blocked, and undefined. The FILEDEF for the input file must specify at least the RECFM and BLOCK; for fixed block files the LRECL must also be specified.
- When copying a variable length data set (RECFM=V or VB) from an OS disk to a CMS disk or SFS directory, the logical record length (LRECL) of the file that is created is equal to the size of the largest record in the data set being copied. If the file being created has a file mode of 4, the logical record length will be equal to the LRECL of the largest record plus 8 bytes. The actual LRECL of the new file can be determined by using the CMS LISTFILE command.
- For OS compatibility of the output tape labels, you must specify LRECL and BLOCK/BLKSIZE in your output FILEDEF.
- Any attempt to move an empty OS data set that has not been closed will cause unpredictable results.
- The MOVEFILE command does not support a record of zero bytes in a disk file.
- The MOVEFILE command does not support multivolume tape processing for the 9346 cartridge tape unit.
- The 9346 cartridge tape can only be written to at load point and at logical end of tape.
- If the output device specified is a printer and the LRECL specified is larger than the blocksize being used, the length of the data which is moved is determined as follows: for an F or U record format, the length of the data being moved equals the blocksize; for a D or V record format, the length of the data being moved equals the blocksize minus 4.
- If the output device specified is a tape, an EOF (end of file) tape mark will be written after
the last output data record. The tape label type specified in the FILEDEF determines whether more
than one tape mark is written signalling EOF or EOV (End Of Volume). Table 1
lists what tape marks and labels are written:
Table 1. Tape Marks and Labels Written When Output is to Tape Tape Label Type Number of Tape Marks After Data Trailer Label Types Number of Tape Marks After Labels CLOSE LEAVE Positioning SL 1 EOFx 2 Between last two tape marks SL 1 EOVx 1 Not applicable (new tape mounted) SUL 1 EOFx 2 Between last two tape marks SUL 1 EOVx, UTLx 1 Not applicable (new tape mounted) AL 1 EOFx 2 Between last two tape marks AL 1 EOVx 2 Not applicable (new tape mounted) AUL 1 EOFx 2 Between last two tape marks AUL 1 EOVx, UTLx 2 Not applicable (new tape mounted) BLP 2 Not applicable Not applicable Between last two tape marks NL 2 Not applicable Not applicable Between last two tape marks LABOFF (default) 1 Not applicable Not applicable After tape mark - MOVEFILE can be used to process non-OS CMS type files with LRECL sizes up to 65535. However, you
must take care when writing a CMS file type to a true OS type file, because the maximum nonspanned
LRECL for OS fixed files is 32760. Normal OS variable files have a maximum LRECL of 32756. Only OS
variable spanned files under Extended Logical Record Interface (XLRI) processing can range to an
LRECL of 65535. Even then, you must allow for a 4-byte record length field as part of the total
record data length. Therefore, the effective length of the actual data in the OS record is really
65531.
Casual movements between CMS and true OS file types can cause data to be truncated with no notification when large LRECL values are involved. For example, a module file with the maximum CMS RECL of 65535 cannot be moved into an OS variable spanned format and then restored, because data will be truncated in the OS format.
For a definition of OS type data, see FILEDEF. For more information on internal OS data formats and variable record length fields, see z/VM: CMS Application Development Guide for Assembler.
Default Device Attributes
- If the block size was not specified, the default is set according to Table 2.
- If the logical record length is not specified,
- For F or U record formats, the default logical record length is equal to the block size specified in Table 2.
- For D or V record formats, the logical record length equals the block size specified in Table 2 minus 4.
- For more information on the default block size and logical record length and interface (used with spanned records), see FILEDEF.
| Device | Input ddname | Output ddname | ||
|---|---|---|---|---|
| RECFM | Block size | RECFM | Block size | |
| Card Reader | F | 80 | NA2 | NA2 |
| Card Punch | NA2 | NA2 | F | 80 |
| Printer | NA2 | NA2 | U | 132 |
| Terminal | U | 130 | U | 130 |
| Tape1 | U | 3600 | RECFM of input ddname | Block size of input ddname |
| ANSI Tape | D | 2048 | RECFM of input ddname | Block size of input ddname |
| Disk or Directory | RECFM of file | Block size of file | RECFM of input ddname | Block size of input ddname |
| Dummy | NA1 | NA2 | RECFM of input ddname | Block size of input ddname |
|
Notes:
|
||||
Conflicting Default Attributes May Arise
If the user does not specify file attributes completely using FILEDEF (RECFM, LRECL, and BLKSIZE), MOVEFILE may substitute or default the omitted attributes. These attributes can conflict with other attributes previously specified by the user. MOVEFILE obtains default information from the CMS file through an ESTATE. This information does not reflect true OS/SIMULATION attribute characteristics unless file mode type is 4.
Examples
"TEST FILE A1" has the following characteristics:
RECFM = V
LRECL = 19
Example 1
"FILEDEF IN DISK TEST FILE A1 (RECFM V LRECL 24 BLKSIZE 28"
"FILEDEF OUT TERM"
"MOVEFILE IN OUT"
This file definition will work properly because the LRECL is at least four bytes bigger than the actual CMS file, and the BLKSIZE is at least 4 bytes bigger than the LRECL. The four byte difference is due to the Record Descriptor Word and the Block Descriptor Word used for variable records in OS/SIMULATION. For more information on using OS/MVS Simulated data sets in CMS, see z/VM: CMS Application Development Guide for Assembler.
Example 2
"FILEDEF IN DISK TEST FILE A1 (RECFM V LRECL 24"
"FILEDEF OUT TERM"
"MOVEFILE IN OUT"
This file definition will fail. In this case, the BLKSIZE is not specified. MOVEFILE will calculate the BLKSIZE by adding 4 bytes to the ESTATE LRECL size (19). The characteristics of the file end up being LRECL=24 (specified by the user) and BLKSIZE=23 (calculated from ESTATE information). Since the BLKSIZE must be 4 bytes bigger than the LRECL for variable data, an error will occur when the file is opened.
Responses
DMSMVE225I PDS member membername moved
DMSMVE226I End of PDS moveDMSMVE706I Terminal input; type null line for end of data The input ddname
in the MOVEFILE specified a device type of terminal. This message requests the input data; a null
line terminates input.
DMSMVE708I File FILE ddname A1 assumed for DDNAME ddname
No file definition is in effect for a ddname specified on the MOVEFILE command. The MOVEFILE issues
the default FILEDEF command: FILEDEF ddname DISK FILE ddname A1 If the input
file does not exist, MOVEFILE terminates processing.
DMSMVE002E File fn ft fm not foundDMSMVE2521I MOVEFILE cannot be performed on empty file fileid
MOVEFILE detected the input file was empty before it opened the output file. Processing stops. If it
could not detect the input file was empty before opening the output file, MOVEFILE issues this
message and both versions of message DMSMVE173E.Messages and Return Codes
- DMS002E File[(s)] [fn [ft [fm]]] not found [RC=28]
- DMS003E Invalid option: option [RC=24]
- DMS037E Output filemode mode[(vdev)] is accessed as read/only [RC=36]
- DMS041E Input and output files are the same [RC=40]
- DMS069E Output filemode mode is not accessed [RC=36]
- DMS070E Invalid parameter parameter [RC=24]
- DMS073E Unable to open file {ddname|fn} [RC=28]
- DMS075E Device devtype invalid for {input|output} [RC=40]
- DMS086E Invalid DDNAME ddname [RC=24]
- DMS089E Open error code nn on {fn|SYSaaa|tapn} [RC=36]
- DMS127S Unsupported device for DDNAME [RC=100]
- DMS128S I/O error on input after reading nnn records; input error code on DDNAME [RC=100]
- DMS129S I/O error on output writing record number nnnn; output error code on DDNAME [RC=100]
- DMS130S Blocksize on V format file ddname is less than 9 [RC=88]
- DMS173E Empty output file fileid not created [RC=40]
- DMS173E Output file may have been erased due to empty condition [RC=40]
- DMS225I PDS member membername moved
- DMS226I End of PDS move
- DMS1116E Invalid value value for BLKSIZE in outddname [RC=32]
- DMS2139I VDEV vdev SENSE gives ERA/RAC=rc; cartridge may not be valid for I/O
- DMS2521E MOVEFILE cannot be performed on empty file [RC=88]
- DMS3919I Zero length input records not moved to output file.
