You can build a CMS file in your virtual card punch using the &PUNCH and &BEGPUNCH control statements. Depending on the spooling characteristics
of your virtual punch, the file that you build may be sent to another
user's card reader, or to your own virtual card reader. When you read
the file with the CMS READCARD command, the spool reader file becomes a eMS disk file. The following example illustrates how you might use your card punch
and redder to update a CMS file by adding records to the end of it. The
file being updated is the DATA EXEC, which is the input file for the BDAY EXEC, shown in the example in "Stacking Data Files." You could
create a separate EXEC to perform the update, but this example shows how
you might modify the BDAY EXEC to perform the addition function
(ellipses indicate the body of the EXEC, which is unchanged): &CONTROL ERROR &IP &1 EQ ADD &GOTO -ADDNAME &EXIT -ADDNAME &TYPE ENTER FIRST NAME AND DATE IN FORM MM/DD/YY &READ VARS &NAME &DATE
&IP .&NAME = . &SKIP 3 &PUNCH &NAME &DATE &TYPE ENTER NEXT NAME OR NULL LINE: &SKIP -4 CP SPOOL PUNCH TO * CP CLOSE PUNCH READCARD NEW NAMES COPYFILE NEW NAMES A DATA EXEC A (APPEND &IP &RETCODE = 0 &SKIP 2 &TYPE ERROR CREATING FILE &EXIT &RETCODE
ERASE NEW NAMES When BDAY EXEC is invoked with the keyword AtD, you are prompted to
enter lines to be added to the data file. Each line that you enter is
punched to the card punch. When you enter a null line, indicating that
you have finished entering lines, the CP commands SPOOL and CLOSE direct
the spool file to your card reader and close the punch.
The file is read in as the file NEW NAMES, which is appended to the
file DATA EXEC using the COPYFILE command with the APPEND option. The
file NEW NAMES is erased and the EXEC terminates processing. When you punch lines in your virtual punch, the lines are not released
as a CP spool file until the punch is closed. Since the EXEC processor
does not close the virtual punch when it terminates processing, you must
issue the CLOSE command to release the file. You can do this in the EXEC with the command line: CP CLOSE PUNCH or from the eMS environment after the EXEC has finished. If you use the CLOSE command in the EXEC, you must preface it with CP. 296 IBM VM/370 eMS User's Guide
The CMS PUNCH command, which you can use in an EXEC to punch an
entire CMS file, does close the punch after punching a file. Therefore,
if you want to create a punch file using a combination of &PUNCH control
statements and PUNCH commands, you must spool your punch using the CO NT
option, so that a close request does not affect the file: CP SPOOL PUNCH TO * CONT &PUNCH FIRST FILE &PUNCH PUNCH FILE1 TEST ( NOH EADER &PUNCH SECOND FILE &PUNCH PUNCH FILE2 TEST ( NOHEADER CP SPOOL PUNCH CLOSE NOCONT The preceding example punches title lines introducing the files punched
with the CMS PUNCH command. The null &PUNCH statements punch blank
lines. The PUNCH command is issued with the NOH EADER option, so that a
read control card is not punched. You can also use an EXEC procedure to punch a job to send to the batch facility for processing. The batch facility, and an example of
using an EXEC to punch a job to it, are described in "Section 12. Using the eMS Batch Facility."
All lines punched virtual card punch are fixed-length# 80-character records. When you use the &PUNCH control statement in a to the
fixed-length EXEC file, EXEC EXEC. scans only the first 72 columns of the
If you want to punch a word that contains more than eight characters,
you must use the &BEGPUNCH control statement, which also, in
fixed-length files, causes EXEC to punch data in columns 1 through 80. Section 14. Building EXEC Procedures 297
Previous Page Next Page