ZUDFM OAA-add LRECs to a subfile

Use this command to add logical records (LRECs) to the subfile to which you are currently linked. You can add LRECs to the end of the subfile or at a specific position in the subfile.

Requirements and restrictions

  • Before using this command, you must first link to and display the file that you want to access.
  • You cannot use this command with a sequence number when the file has default keys defined.
  • You cannot use this command to add technical LRECs (TLRECs).
  • This command does not support large logical records (LLRs).
  • The TPF system must have get file storage (GFS) pools enabled before you can use this command. Pools are not enabled until the system is cycled to CRAS state or above.

Format

Read syntax diagramSkip visual syntax diagram ZUDFM OAA- -ADD lrecnum / lrecid did ssidditxt datacontent
Note: You can use either the ZUDFM OAA or the ZUDFM ADD command.
lrecnum
is the sequence number that is used for the added LREC. This parameter is a decimal number between 1 and 999999.
lrecid
is the 1-byte primary key of the LREC.
did
is the 2-byte userLREC data identifier.
ssi
is the 2-byte size of the subLREC.
ddi
is the data definition that identifies the type of 2-byte subLREC.
txt
is the data content of the subLREC.
datacontent
is EBCDIC data, or hexadecimal data, or both, to define the contents of the user LREC data field.
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 the ACPDBE macro.

Additional information

  • If there are no keys defined in the database definition (DBDEF) table, and if you do not specify the positional LREC number parameters, the TPFDF product adds the new LREC at the end of the subfile. Similar to the TPFDF DBADD macro, the ZUDFM OAA command uses designated keys to identify the location where an LREC is added.
  • You must specify a sequence number with a file that uses algorithm #TPFDB0D.
  • When the ZUDFM OAA command adds an LREC, the LREC size is dynamically calculated and inserted in the 2-byte field.
  • You can ensure that every new LREC is added in the correct position by having the default keys and file organization defined in the DBDEF by the database administrator.
  • 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.

    Note:
    • 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 specified LREC added to the subfile. The LREC is inserted into the appropriate position of the subfile because the file has default keys defined. The standard TPFDF LREC DISPLAY heading is displayed after the LREC has been added to the file.

 User: ZUDFM OAA/80|SMITH|0000000000123456
System: UDFM0001I TPFDF LREC DISPLAY F.A. 00000000F404F868 000001 001080 B R O C K E R0000 00345874 000002 001080 D U N N00 00000000 00328065 000003 001080 I N O U Y E000000 00690794 000004 001080 J A C O B S000000 00669412 000005 001080 J O N E S 00000000 00789441 000006 001080 S M I T H 00000000 00123456 000007 001080 T A Y L O R000000 00123964 000008 001080 T H A Y E R000000 00236348 000009 001080 U N D E R H I L L 00894350 OAA/80|SMITH|0000000000123456 

The following example adds an extended LREC, where the primary key is X'C0' and the DID is X'2010', as the second LREC in the subfile that is currently linked.

User: ZUDFM OAA2/C02010|LONDON, ENGLAND
System: UDFM0001I TPFDF LREC DISPLAY F.A. 00000000A076908B 000001 000EC000 00060008 2000 M A D R I D , S P A I N 000002 0018C000 00060012 2010 L O N D O N , E N G L A N D 000003 001FC000 00060019 2080 P A R I S , F R A N C E T A P A R T ZUDFM ADD 2/C02010|LONDON, ENGLAND 

The following example adds an extended LREC with two subLRECs to the currently linked file, which already contains one extended LREC with no subLRECs.

 User: ZUDFM OAA/C02222-0006C1C1F1F10007C2C2F2F2F2-|USERLREC
System: UDFM0001I TPFDF LREC DISPLAY F.A. 0000000000980013 000001 0012C000 0006000C 1111 U S E R L R E C 000002 001FC000 00130006 A A 1 1 0007 B B 2 2 200 0C2222 US E R L R E C ZUDFM ADD /C02222-0006C1C1F1F10007C2C2F2F2F2-|USERLREC

The previous example shows information for LREC 1 and LREC 2.

  • Information for LREC 1 includes:
    0012
    The size of the entire LREC (SIZ)
    C0
    The primary key (PKY)
    00
    The reserved byte
    0006
    The offset to the userLREC (OFS)
    000C
    The size of the userLREC (SZE)
    1111
    The DID of the userLREC (DID)
    U S E R L R E C
    The data of the userLREC (data content).
  • Information for LREC 2 includes:
    001F
    The size of the entire LREC (SIZ)
    C0
    The primary key (PKY)
    00
    The reserved byte
    0013
    The offset to the userLREC (OFS)
    0006
    The size of the subLREC 1 (SSI)
    A A
    The DDI of the subLREC 1 (DDI)
    1 1
    The data of the subLREC 1 (TXT)
    0007
    The size of the subLREC 2 (SSI)
    B B
    The DDI of the subLREC 2 (DDI)
    2 2 2
    The data of the subLREC 2 (TXT)
    000C
    The size of the userLREC (SZE)
    2222
    The DID of the userLREC (DID)
    U S E R L R E C
    The data of the userLREC (data content).