Previous Topic: Update a VSAM RecordNext Topic: Mass Insertion into a VSAM File


Add a VSAM Record

To add a record, specify the ADD operation on the FILE definition.

  1. Specify the following required information:
    FUNC= ADDN	(to obtain a new work area)
    

    or

    FUNC=ADDU	(to use the data in the current work area) 
    

    Press Enter to get the work area to be used for the new record. FILE displays the maximum record length in the SIZE field and ADD in the MODE field.

  2. Specify the following optional information:
    FUNC=CHGE
    SUBFUNC=FILL
    DATA=data string
    

    Press Enter.

  3. Change the data in the work area to meet your requirements. See Change Data in the Work Area for details.
  4. To write the updated record, enter the following required information:
    FUNC= PUT
    RCID= record id
    SIZE= record length
    

    For a KSDS file, the record ID overlays the key portion of the record.

    Note: Specify the SIZE field only when adding a variable length record. Press Enter. FILE redisplays the new record and displays the message RECORD ADDED.

  5. If you decide not to add this record, specify FUNC= REL. FILE continues to display the record and displays the message FWA HAS BEEN RELEASED.