Using the WRITEV Function to Update KSDS VSAM Files (Mainframe Only)

The WRITEV function updates existing VSAM files. You can use the WRITEV function to add, modify, or delete records. One record is processed for each call to WRITEV. You must ensure that the records are in the format expected by the VSAM file.

EngageOne™ Enrichment can process any number of files simultaneously. As shown below, you can use WRITEV with EngageOne™ Enrichment to update VSAM files that are used with the LOOKUPV function.
Note: When a sequential file is updated, it is written out in optimized form (sorted with blank records removed).

You cannot use the UPDATE function with tables.

/* Update the customer billed-to-date amount in the customer record */
%%custrec = LOOKUPV(DD:CUSTOMER,%%custnum) /* Get customer record   */
%%billed = RGET(%%custrec, I, 10)          /* Extract billed        */
                                           /*    amount             */
%%billed = %%billed + %%invoice_amount     /* Increase billed       */
                                           /*    amount             */
%%custrec = RPUT(%%custrec, %%billed, I, 10)/* Put back in record   */
%%result = WRITEV(DD:CUSTOMER, %%custrec, %%custnum)/* Update record */