Werbung
Werbung
v
INPUTMSG is supplied with a null address.
Default action: Terminate the task abnormally.
REWRITE
Update a record in a file.
(1)
REWRITE FILE (
name
) FROM (
data-area
)
LENGTH (
data-value
)
SYSID (
name
)
Notes:
1
DATASET is also accepted, but FILE is the preferred term (see “DATASET option” on page 311).
Conditions:
DUPREC, FILENOTFOUND, ILLOGIC, INVREQ, IOERR, ISCINVREQ, LENGERR, NOSPACE,
NOTAUTH, SYSIDERR
Description
The REWRITE command updates a record in a file on a local or a remote system.
You must always precede this command with a READ UPDATE to read the record to be updated.
Any key embedded in the record of the physical file should not be changed.
Refer to Chapter 10, “File control,” on page 115 for more information about this
command.
Options
FILE(
name
)
specifies the name of the file to be accessed. The name must be alphanumeric, up to 8 characters long, and must have been defined in the file control table
(FCT) unless the SYSID option specifies a remote system.
If a nonlocal SYSID is specified, the underlying file is assumed to be on a remote system irrespective of whether the name is defined in the local FCT.
Otherwise, the FCT entry is used to determine whether the underlying file is on a local or a remote system.
FROM(
data-area
)
specifies the record to be written to the file.
LENGTH(
data-value
)
specifies as a halfword binary value the length of the record to be written.
If SYSID is specified, LENGTH must be coded. You must also specify this option for a file defined as containing variable-length records. It need not be specified if the file contains fixed-length records, but its inclusion is recommended because it causes a check to be made to ensure that the length of data being written is equal to that defined for the file. If the lengths are not equal, the LENGERR condition occurs.
Chapter 32. Application programming commands - reference
427
SYSID(
name
)
specifies the name of the system to which the request is directed. The name can be up to 4 characters long.
If you specify SYSID, you must also specify LENGTH; it cannot be found in the FCT.
Exception Conditions
Note:
RESP2 values are not set for files that are on remote systems.
DUPREC
RESP2 values:
150
The record to be written contains a key that is the same as the key of a record already in the file, and the file accepts only unique keys. The key may be a primary key of a KSDS or an alternate key of a logical view of a file.
Default action: Terminate the task abnormally.
FILENOTFOUND
RESP2 values:
1
The name specified in the FILE option cannot be found in the FCT.
Default action: Terminate the task abnormally.
ILLOGIC
RESP2 values:
110
There is an error that does not fall within one of the other CICS response categories. (Further information is available in the EIBRCODE
field; refer to Appendix A, “EXEC interface block,” on page 529 for
details.)
Default action: Terminate the task abnormally.
INVREQ
RESP2 values:
30
A REWRITE command is issued for a file that has not had a previous
READ UPDATE successfully issued.
Default action: Terminate the task abnormally.
IOERR
RESP2 values:
120
There is an I/O error during the file control operation. An I/O error is any unusual event that is not covered by a CICS exception condition.
(Further information is available in the EIBRCODE field; refer to
Appendix A, “EXEC interface block,” on page 529 for details.)
Default action: Terminate the task abnormally.
ISCINVREQ
RESP2 values:
70
The remote system indicates a failure that does not correspond to a known condition.
428
CICS for iSeries Application Programming Guide V5
Default action: Terminate the task abnormally.
LENGERR
RESP2 values:
10
The LENGTH option is not specified for a file with variable-length records.
12
14
The length specified exceeds the maximum record size; the record is truncated.
An incorrect length is specified for a file with fixed-length records.
Default action: Terminate the task abnormally.
NOSPACE
RESP2 values:
100
No space is available on the disk for adding the updated record to the file
Default action: Terminate the task abnormally.
NOTAUTH
RESP2 values:
101
A resource security check has failed on FILE(
name
).
Default action: Terminate the task abnormally.
SYSIDERR
RESP2 values:
130
The SYSID option specifies either a name that is not defined in the terminal control system table (TCS), or a system to which the link is closed.
Default action: Terminate the task abnormally.
Examples
For example:
EXEC CICS REWRITE
FROM(RECORD)
FILE(’MASTER’)
Chapter 32. Application programming commands - reference
429
Herunterladen
Werbung