BLOCKSIZE specified is greater than the track capacity of the disk
device being used. You cannot use the ERASE or PURGE options of the EXPORT command if
you are exporting a VSAM file from a read-only disk. The export
operation succeeds, but the listing indicates an error code 184, meaning
that the erase function could not be performed. You should not use an EXPORT DISCONNECT function from a CMS minidisk
and try to perform an IMPORT CONNECT function for that data set onto an OS OS incorrectly rebuilds the data set control block (DSCB) that indicates how much space is available.
The AMSERV file below gives an example of using the REPRO function to
copy a CMS sequential file into a VSAM file. The CMS input file must be
sorted in alphameric sequence before it can be copied into the VSAM file, which is a keyed sequential data set (KStS). The VSAM cluster, NAME.LIST, is defined in an AMSERV file named PAYROLL: DEFINE CLUSTER ( NAME (NAME.LIST ) - VOLUMES (CMSDEV) - TRACKS (20) -
FILE (BOOK) - KEYS (14,0) - RECORDSIZE (120,132) ) -
DATA (NAME (NAME.LIST.DATA) ) - INDEX (NAME (NAME. LIST. INDEX ) )
To sort the CMS file, create the cluster and copy the CMS file into it,
use the following commands:
sort name list a name sort a DMSSRT604R ENTER SORT FIELDS: 1 14
access 135 c c (perm
amserv a roll
sort a ems name sort 1IIIIllililliIBI:I:lj! dlbl name c dsn name list
amserv repro
The file REPRO AMSERV contains: REPRO INFILE ( SORT ENV (RECORDFORMAT (F) - BLOCKSIZE (80) - PDEV (3330) ) ) - OUTFILE (NAME) vsam When you use the REPRO, IMPORT, or EXPORT functions with tape files,
you must remember to use the TAPIN and TAPOUT options of the AMSERV command. These options perform two functions: they allow you to specify
the device address of the tape, and they notify AMSERV to prompt you to
enter a ddname.
In the example below, a VSAM file is being exported to a tape. The
file, TEXPORT AMSERV, contains: EXPORT NAME.LIST­ INFILE (NAME) - OUTFILE (TAPE ENV (PDEV (2400) ) ) 208 IBM VM/310 CMS User's Guide
March 30, 1979
To execute this AMSERV, you enter the commands as follows:
vsam
labeldef tapefid tapf volid dept10 exdte 79040 amserv texport (tapout 181 DMSAMS361R ENTER TAPE OUTPUT DDNAMES: tape
The fid, volid, and exdte parameters on LABELDEF are only examples;
you can substitute any value you want for them on your tape label. WRITING EXECS FOR AMSERV AND VSAM you may find it convenient to use EXEC procedures for most of your AMSERV functions, as veIl as setting up input and output files for
program execution, and executing your VSAM programs. If, for example, a
particular AMSERV function requires several disks and a number of DLEL
statements, you can place all of the required commands in an EXEC file.
For example, if the file below is named SETUP EXEC: ACCESS 135 B ACCESS 136 C ACCESS 137 D ACCESS 300 G DLBL IJSYSCT G .11111\;111;1,1;0;1;:·;;1' DLBL EILEl B DSN FIRST FILE IVc.:lI. M
\ • ...,n ...... DLBL FILE2 C DSN SECOND FILE (VSAM DLBL FILE D DSN THIRD FILE (VSAM AMSERV MULTFILE to invoke this sequence of commands, all you have to enter is the name
of the EXEC: If you place, at the beginning of the EXEC file, the EXEC control
statement: &ERROR &EXIT &RETCODE then, you can be sure that the AMSERV command does not execute unless
all of the prior commands completed successfully.
For those AMSERV functions that issue response messages, you can use
the &STACK EXEC control statement. For example: &ERROR &EXIT &RETCODE ACCESS 305 D DLBL OUTPUT D (VSAM SISGtll LABELDEF TAPE FID FILE1 &ERROR &CONTINUE &STACK TAPE AMSERV TIMPORT (TAPIN 181
&IF &RETCODE NE 0 TYPE TIMPORT LISTING TAPE REi &EXIT 0 Section 10. Using Access Method Services and VSAM 209
Previous Page Next Page