MPE/iX System Utilities Reference
> Chapter 8 FCOPYOperation |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FCOPY FROM=input file;TO=output file;functionsFor example, to create a new disk file (in exactly the same format as another file) use the NEW parameter: > FROM=OLDFILE;TO=NEWFILE;NEWTo copy a subset of one file to another enter: > FCOPY FROM=FILEONE;TO=FILETWO;SUBSET=29:33In this example FCOPY copies the 30th through 34th records. You specify ;SUBSET=29:33 because FCOPY sees the first record in a file as record number 0. To copy a tape created in EBCDIC format in an IBM environment with a label of VOL 000001,IBM you would enter the following: FILE T;DEV=TAPE;LABEL=000001,IBM;REC=-132,20,F,ASCII FILE HPFILE;REC=-132,1,F,ASCII;DISC=12000 FCOPY FROM=*T;TO=*HPFILE;NEW;EBCDICINBe sure the parameters in the file equations (blocking factor, record size, etc.) are correct. To copy a file to your terminal screen in hexadecimal format enter: FCOPY FROM=FILEONE;TO=;HEXIf you specify ;TO= without anything after it the default is the $STDLIST device. "From" and "To" FilesA from file is the input file for an FCOPY command; it contains the data you want to copy. A to file is the output file to which you want to copy the data. Identify a from file for an FCOPY command with the FROM parameter. FROM has the following format: [={fromfile}] FROM [={ * }] [={<empty>}]The value you assign to FROM can be either an input file name (fromfile), an asterisk (*), or nothing at all (<empty>). An asterisk backreferences the fromfile named in a file equation. Leaving FROM empty lets you use your terminal (or a spoolfile during a job) as the input file. In the example below, the FROM parameter describes an input file named input for an FCOPY command. FROM=inputSpecify a to file with the TO parameter. TO has the following format: [={tofile }] ;TO [={* }] [={<empty >}]The value that you assign to TO can be either the name of the output file (tofile), an asterisk (*), or nothing at all (<empty >). An asterisk backreferences a file named in a file equation. Leaving TO empty lets you copy files to the $STDLIST device. The example below describes an output file name outfile for an FCOPY command. ;TO=outfile FCOPY FunctionsIn addition to specifying input and output files in an FCOPY command, you also describe the FCOPY functions that you want to perform. Each function has its own syntax and guidelines for its use. The NEW function, for example, lets you create a new disk file. An example of an FCOPY command using the NEW function is: FCOPY >FROM=oldfile;TO=newfile;NEWThe table below lists FCOPY functions and their descriptions in alphabetical order. Table 8-1 FCOPY Functions
Defining FilesIf you are copying files from or to devices other than disk, you must define the files and their associated devices with the FILE command before issuing an FCOPY command. For example, to copy a file from magnetic tape to a line printer, define two device files as follows: FILE TAPEFILE;DEV=TAPE;REC=-80,25,F,ASCII FILE PRINTER;DEV=LPTAPEFILE and PRINTER are the formal file designators you use in the FCOPY command. TAPE and LP are device class names for a magnetic tape unit and a line printer respectively. Device class names are defined when the system is configured and may vary from one installation to another. You may use the two formal file designators as the "from" and "to" files in an FCOPY command. Type an asterisk (*) before each file name to tell FCOPY to refer to the previous FILE command for the file's description. The FROM and TO parameters below reference the two files defined above: FROM=*TAPEFILE;TO=*PRINTERFCOPY assumes files to have default characteristics unless you define the files with other characteristics. For more information on the FILE command, refer to the MPE/iX Commands Reference Manual. General Guidelines for FCOPY CommandsAn FCOPY command must follow these general guidelines:
Using FCOPY with KSAM FilesTo FCOPY from an old compatibility mode KSAM file to a new compatibilty mode KSAM file enter: FCOPY FROM=OLDFILE;TO=(DATAFILE,KEYFILE)OLDFILE is the old compatibility mode KSAM data file. DATAFILE is the new compatibility mode data file and KEYFILE is the new compatibilty mode key file. The new key and data files are constructed for you with exactly the same structure as the old key and data files. The ;NEW option need not be used. To FCOPY from an MPE/iX file (a flat file) to an old KSAM file (compatibility or native mode) enter: FCOPY FROM=FLATFILE;TO=KSAMFILETo FCOPY from a KSAM file to an old flat file enter: FCOPY FROM=KSAMFILE;TO=ANYFILEKSAMFILE is either a native mode KSAM file or compatibility mode KSAM data file. ANYFILE is an old MPE/iX file. To FCOPY from a compatibility mode KSAM file, but to treat the file as if it were an MPE/iX flat file, enter: FCOPY FROM=KSAMFILE;TO=ANYFILE;NOKSAMYou may use the NOKSAM parameter with only compatibility mode KSAM files. To FCOPY from any old KSAM file (compatibility or native mode) to a new native mode KSAM file enter: FCOPY FROM=OLDFILE;TO=(NEWFILE)OLDFILE is the old KSAM file. NEWFILE is the new native mode KSAM file. Additional DiscussionFor more information refer to the FCOPY Reference Manual.
|