# JCL MVA

Updated: 10/23/2020, 1:48:27 PM
Created: 10/23/2020, 1:48:27 PM
Last Updated By: Mike Street
Read Time: 2 minute(s)

Tags: copy jcl buffer file

# Description

This command copies a value from the source to the destination buffer and stores it as a multivalue. It takes the general form:

MVA destination source
1

where:

  • destination is a direct or indirect reference to a buffer or select register which is to receive the data.
  • source is the data to be copied. The source can be a direct or indirect reference to a buffer or select register, or a literal string.

# Note

New values will be copies to the destination in ascending ASCII  sequence. If a new value already exists in the destination buffer, it will not be copied. If the source data is multivalued, it will be copied to the destination without modification. This might create duplicate values and invalidate the ascending sequence.

If the destination is the input buffer, the buffer pointer will be left at the beginning of the destination parameter.

# Example 1

PIB contains: ABC^DEF^GHI

|    Command  | File Buffer 1 Before | File Buffer 1 After |
|    -------  | -------------------- | ------------------- |
| MVA &1.1 %3 | 000 Key              | 000 Key             |
|             | 001 FFF]HHH          | 001 FFF]GHI]HHH     |
|             | 002 YYY              | YYY                 |
1
2
3
4
5

# Example 2

File buffer 2 contains:

000 Key
001 GG]YY
002 AAA
1
2
3
|    Command    | File Buffer 1 Before  | File Buffer 1 After  |
|    ------     | --------------------  | -------------------- |
| MVA &1.1 &2.1 | 000 Key               | 000 Key              |
|               | 001 FFF]HHH           | 001 FFF]GG]YY]HHH    |
|               | 002 YYY               | YYY                  |
1
2
3
4
5

Back to jCL.