Use this command to replace the user data portion of a logical record
(LREC).
Requirements and Restrictions
- Before using this command, you must first link to and display the file
that you want to access.
- If you do not replace an LREC successfully, you must display it again
before you can use this command.
- You must specify the LREC to be changed by its sequence number in the
subfile. Locate the sequence number by displaying a subfile using the
ZUDFM OAI, ZUDFM OA, or ZUDFM OA* command.
- You cannot use this command to replace technical LRECs (TLRECs) or to
replace an LREC with a TLREC.
Format
- Note:
- You can use either the ZUDFM OAR or the ZUDFM REPLACE command.
- lrecnum
- is the sequence number of the LREC.
- LBL-label
- specifies the DSECT field to be replaced. Do not include the first
4 characters of the DSECT name. When using this parameter with fixed
length fields, the length of the data content must match the length of the
field.
- Note:
- When using this parameter, you must build a macro label set using macro label
set support (MLS).
- ORG-lrecid
- specifies the LREC ID, where lrecid is a 1-byte field in which
the label is defined. Use this parameter when the label specified by
the LBL parameter is not defined for the LREC ID of the record being
replaced. This parameter indicates the LREC ID for which the label is
defined.
- datacontent
- is the user data portion of the LREC.
- Note:
- This variable can contain a mixture of hexadecimal and character data.
To switch between these types of data, use the vertical bar (|) as a
delimiter. The following example shows how the types of data can be
mixed:
8013B4|THIS IS CHARACTER DATA|4A5F90
The TPFDF product assumes that the variable starts with hexadecimal
data. To start with character data, place a vertical bar at the
beginning of the variable. For example:
|STARTING WITH CHARACTER DATA|1F2E3D4E
You can use a different delimiter by setting variable #DBENUFB in
the ACPDBE macro. See TPFDF Installation and
Customization for more information about ACPDBE.
Additional Information
- Use the ZUDFM OAR command to read, modify, and replace user data in LRECs
in a subfile to which you are currently linked.
- If you do not use the label parameter, you must specify the primary key of
the LREC (the LREC ID) when you add data to it. Do not enter the LREC
length field, if any.
- You cannot change the size field in the LREC directly; the TPFDF
product adjusts the LREC size field for you.
- There is a danger of damaging the file organization using this
command. The best way to ensure database integrity is for the database
administrator to define default keys and file organization in the database
definition (DBDEF) table. In this case, if you change data in an LREC
that would corrupt the organization of the subfile, the TPFDF product
automatically moves the LREC with the replacement data to the correct position
in the subfile.
- When you use a ZUDFM OA command to display a subfile that you are going to
modify (ZUDFM OAA, ZUDFM OAR, or ZUDFM OAX) there is a time interval during
which another entry could modify the same subfile. Consequently, your
modification could inadvertently change the wrong LREC in the subfile and
damage the database.
To overcome this problem, the TPFDF product maintains a sequence counter
that is used by ZUDFM to ensure file integrity. The sequence counter is
updated in the block header whenever the subfile is changed. In
subsequent entries the retained value is compared with the actual value to
ensure that the database is updated in the correct sequence.
Heavily modified databases may become difficult to maintain with ZUDFM
entries if the sequence count is constantly being changed. In this
case, write your own utilities to locate the file, hold it, and change
it.
- Attention:
- If you enter multiple ZUDFM OA commands that modify a subfile, the sequence
counter is not checked. In other words, you are allowed to modify the
subfile more than once without having to display it before each ZUDFM OA
command. You will only receive a sequence error if another user or
application program modifies the subfile while you are entering the ZUDFM OA
commands.
Examples
The following example shows the text portion of an LREC that is being
replaced.
+--------------------------------------------------------------------------------+
|User: ZUDFM OAR3/80|UPDATED TEXT |
| |
|System: UDFM0001I TPFDF LREC DISPLAY |
| |
| F.A. F404E801 |
| 000002 000E80 L R E C T E X T 2 |
| 000003 000F80 U P D A T E D T E X T |
| 000004 000E80 L R E C T E X T 4 |
| 000005 000E80 L R E C T E X T 5 |
| OAR3/80|UPDATED TEXT |
+--------------------------------------------------------------------------------+
References