Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

PUTX - Replace record

ISAM:

Macro type:

R for PARMOD=24
O for PARMOD=31

SAM:

Macro type:

R for PARMOD=24
R for PARMOD=31

SAM:

The PUTX macro may be used only for disk files processed in locate mode and opened with OPEN UPDATE. It writes an updated record back to the buffer. The record must have been retrieved beforehand by means of the GET macro (for ISAM also GETR, GETKY or GETFL) and its length must not have been changed during updating.

In locate mode, the PUTX macro places the record in the program buffer and sets a flag indicating that the buffer contents have been changed. The buffer contents are written back to the file only when a further macro (such as the next GET) triggers an SVC for this file or FCB.

ISAM:

The PUTX macro overwrites a record which was previously retrieved by means of a GET, GETR, GETKY or GETFL macro. With GETFL in conjunction with SHARUPD=YES, the LOCK operand must be selected.

The record key must not be changed either in move mode or locate mode; in locate mode, the record length must also not be changed.

With the exception of OSTAT, no other ISAM action macro may be issued for this file between the read operation using GET and the write operation using PUTX. For shared-update processing, the lock which was set implicitly or explicitly with the read operation using the LOCK operand must not be canceled. This means that any action macros issued even for other files/FCBs must not set a new lock; only macros such as a read operation with NOLOCK are possible.

K-ISAM:

When processing K-ISAM files in conjunction with SHARUPD=YES: if a record in a group of records with duplicate keys is output in move mode using PUTX, it is not known which of the records with duplicate keys the file will be positioned to following the PUTX.

The record key must not be changed between the read and write operations. If this is attempted, the effects vary depending on whether the file is being processed in move mode or locate mode:

in either case, the EXLST exit USERERR is taken.

If control information in the record is overwritten in locate mode, the results of subsequent processing will be unpredictable. If this makes it impossible for ISAM to process the block, control is passed to EXLST exit USERERR.

Format

Operation

Operands

PUTX

fcbadr / (1)
[,PARMOD = 24 / 31]

[,area / (0)]

Operand descriptions

area

Address of the record to be written.

(0)
The address of the record is stored in register 0.

fcbaddr

Address of the FCB associated with the file to be processed.

(1)
The FCB address is stored in register 1.

PARMOD

Specifies the generation mode for the macro.


Default value:

the value preset in the program by means of the GPARMOD macro or by the assembler.

= 24
The macro is generated with the expansion for the 24-bit interface. The object code generated can run only in the 16-Mb address space (in 24-bit addressing mode only).

= 31
The macro is generated such that it is independent of the addressing mode (24-bit or 31-bit addressing). The object code generated can run in the 2-Gb address space.

Programming notes

  1. The PUT macro overwrites the contents of registers 0, 1, 14 and 15.

  2. For SAM only:
    The fact that a record has been updated in the current buffer is “noted” in the TU FCB by PUTX. It is only if this bit is set at the time of the next GET (RELSE, SETL) that the entire logical block is written to disk. PUTX never issues an SVC.