Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

%MOVE

&pagelevel(3)&pagelevel

With the %MOVE command you transfer memory contents or AID literals to memory positions within the program which has been loaded. Transfer is effected left-justified without checking and without matching the storage type of the sender to the receiver. The %SET command is required for transfer appropriate to type, as in the COBOL MOVE statement.

  • With sender you designate a data item, an address, an execution counter, an AID register, a COBOL special register, a figurative COBOL constant or an AID literal.
    sender can be located in virtual memory of the loaded program or in a dump file.

  • With receiver you designate a data item, an execution counter, an AID register or a COBOL special register which is to be overwritten. receiver can only be located in virtual memory of the loaded program.

  • With REP you specify whether AID is to generate a REP record in conjunction with a modification which has taken place. This operand has a higher priority than the global setting (see %AID command) but affects only the current %MOVE command.

Command Operand
%M[OVE]

sender INTO receiver [rep]

In contrast to the %SET command, AID does not check for compatibility between the storage types sender and receiver when the %MOVE command is involved, and does not match these two storage types. Type modifications remain without effect.

sender determines the length of the transfer. A length modification in receiver has no effect. If the transfer goes beyond the end of receiver, AID rejects the attempt to transfer and issues an error message.

Input of the command immediately following loading is not recommended as not all entries in the DATA DIVISION will have been initialized (e.g. record definitions and special registers).

In addition to the operand values described here, the values described in the manual for debugging on machine code level can also be employed.

Using %AID CHECK=ALL you can also activate an update dialog, which first provides you with a display of the old and new contents of receiver and offers you the option of aborting the %MOVE command.

The %MOVE command does not alter the program state.

sender
INTO

receiver

For sender or receiver you can specify a data item, a COBOL special register, an execution counter, a register or a complex memory reference. Statement names, source references, figurative constants, addresses and lengths of data items as well as AID literals can only be employed as sender.

sender may be either in the virtual memory area of the program which has been loaded or in a dump file; receiver, on the other hand, can only be within the virtual memory of the loaded program. If program areas are transferred or overwritten with instruction code, the results may be undesirable if addresses are affected which belong to a control-area or tracearea or for which a test point has been set using %INSERT (see AID Core Manual (Related publications) [1]).

No more than 3900 bytes can be transferred with a %MOVE command. If the area to be transferred is larger, you must issue multiple %MOVE commands.

sender-OPERAND - - - - - - - - - - - - - -

- - - empfänger-OPERAND - - - - - -

{  [•][qua•] {  C=segmentname
              | C=sharename
              | dataname
              | statement-name
              | source-reference
              | keyword 
              | compl-memref
             }
 | {%@|L}([•][qua•]{  filename
                    | dataname
                    | compl-memref
                   } 
 | %L=(expression)
 | AID-Literal
}

INTO [•][qua•] {  C=segmentname
               | dataname
               | keyword 
               | compl-memref
              }

- - - - - - - - - - - - - - - - - - - - - - – - - -  - - - - - - - - - - - - -

If the period is in the leading position it denotes a prequalification, which must have been defined with a preceding %QUALIFY command.
Consecutive qualifications must be separated by a period. In addition, there must be a period between the final qualification and the following operand part.

qua

Qualifications need to be specified if an address operand does not apply to the current AID work area or if the intention is to reference an address that is not within the current compilation unit or the current program.

E={VM | Dn} for sender

E=VM for receiver

You specify a base qualification only if the current base qualification is not to apply for a data/statement name, source reference or keyword (see %BASE). sender may be either in virtual memory or in a dump file; receiver, on the other hand, can only be in virtual memory.

S=srcname

is to be specified if sender or receiver is not contained in the current compilation unit.

PROC=program-id

is to be specified only if you address a file name, data name or statement name that is not in the current program or is not unique in the current compilation unit (see chapter “COBOL-specific addressing”). It is also necessary for a global data name that is locally hidden.

If srcname in the S qualification is the same as program-id, only the PROG qualification need be written.

NESTLEV= level-number

level-number    A level number in the current call hierarchy

level-nummer has to be followed by dataname.
Specify NESTLEV=level-number when you want to address a data name on a certain level in the current call hierarchy. This qualification can only be combined with E=, and not with any other qualification.

Only the base qualification or the CTX qualification can be placed before the C qualifications listed below. The C qualification takes the user away from the symbolic level. No symbolic operands can be written directly afterwards (see section “Symbolic memory references”), only a compl-memref.

C=segmentname

Without a length modification, specify the entire segment as the sender or receiver. If the segment is more than 3900 bytes in length, it can only be transferred by using several %MOVEs.

C=sharename

Without a length modification, specify the entire object module as the sender or receiver. If it is more than 3900 bytes in length, it can only be transferred by using several %MOVEs.

dataname

is the name of a data item defined in the source program, i.e. both individual data elements and group items and tables and their elements, or the name of a COBOL special register. Figurative constants can only be used as sender.

If dataname is not unique within a program, it can be marked.

If dataname is the name of a table element, it can be indexed or subscripted in the same way as in a COBOL statement.

dataname [identifier][...][(index[,...])]

identifier

If dataname is not unambiguous within a program, it can be identified by being assigned to a particular group item with IN or OF. dataname must be assigned as many identifiers as are required to designate it unambiguously.
If it is not identified, AID processes dataname if a data definition is provided for it at level 01 or 77. If this is not the case, an error message is issued.

index

is written in the same way as in a COBOL statement, except that indexes must be separated by a comma. If you specify the name of a table element without an index, this means that the entire table will be transferred (in the case of sender). If you specify a table element without an index in the case of receiver, the table will be overwritten beginning at the start address and using the length of sender, without taking into account the subdivision into table elements.
index may be specified as follows:
{  n |  index-name | dataname | TALLY | arithmetic-expression }

COBOL special registers

LINAGE-COUNTER
RETURN-CODE
SORT-CCSN
SORT-CORE-SIZE
SORT-EOW
SORT-FILE-SIZE
SORT-MODE-SIZE
SORT-RETURN
TALLY

Figurative constants

can only be specified as sender; the address selector cannot be used on them.
The figurative constants HIGH-VALUE and LOW-VALUE always represent the alphanumeric value assigned to them by default or in the declarations made with the PROGRAM COLLATING SEQUENCE clause. In contrast to the COBOL MOVE statement, only one character is transferred in the AID command %MOVE when a figurative constant is used.

ZERO
SPACE
HIGH-VALUE
LOW-VALUE
QUOTE
symbolic character

statement-name

designates the address of the first instruction in a section or paragraph in the PROCEDURE DIVISION.

{ L'section' | L'paragraph' [IN L'section'] }

If a paragraph name is not unambiguous within a program, it must be identified by the section name of the section in which it was defined: L'paragraph' IN  L'section'

Statement names are address constants and can only be specified for sender. The address thus designated is then transferred.
With the subsequent pointer operator (statement-name ->) you designate 4 bytes of the program code generated for the first statement in the section or paragraph. For 2-byte or 6-byte instructions you must specify a corresponding length modification. statement-name -> can be used both as sender and receiver. See examples.

source-reference

designates the address of the first instruction generated for a statement in the
PROCEDURE DIVISION and must be specified in one of the following formats:

S’n’

for lines with paragraph or section names in which no COBOL verb occurs.
This specification is not possible for programs which have been compiled with STMT-REFERENCE=COLUMN1-TO-6.

S’nverb[m]’ | S’xverb[m]’

for lines containing a COBOL verb.

Source references are address constants and can only be specified for sender. The address thus designated is then transferred.
With the subsequent pointer operator (source-reference ->) you designate 4 bytes of the program code generated for the statement. For 2-byte or 6-byte instructions you must specify a corresponding length modification. source-reference -> can be used
both as sender and receiver. See examples.

keyword

specifies an execution counter, the program counter, or a register. keyword may only be preceded by a base qualification.

%•subcmdname       Execution counter
%•                 Execution counter of the current subcommand
%PC                Program counter
%n                 General register, 0 <= n <= 15
%nD|E              Floating-point register, n = 0,2,4,6
%nQ                Floating-point register, n = 0,4
%nG                AID general register, 0 <= n <= 15
%nDG               AID floating-point register, n = 0,2,4,6


compl-memref

may contain the following operations (see AID Core Manual (Related publications) [1]):

  • byte offset (•)

  • indirect addressing (->)

  • type modification (%A, %E, %S, %SX)

  • length modification (%L(...), %L=(expression), %Ln)

  • address selection (%@(...))

  • character conversion functions %C() and %UTF16() (for sender only)

If compl-memref begins with a statement name or source reference, it must be followed by a pointer operator ( -> ). In this case statement-name must be specified with L’...’. Without the pointer operator the statement name and source reference can be used anywhere where hexadecimal numbers can be written. A subsequent type modification for compl-memref is pointless, since transfer is always in binary form, regardless of the storage type of sender and receiver. However, a type modification may be necessary before a pointer operation (->).
Example: %0G.2%AL2->
The last two bytes of AID register %0G are to be used as the address.

After byte offset (•) or pointer operation (->), the implicit storage type and implicit length of the original address are lost. At the calculated address, storage type %X with length 4 applies, if no value for type and length has been explicitly specified by the user.
Despite this, the area boundaries of the start address (for example CSECT, dataname, keyword etc.) remain in effect. They must not be exceeded as the result of byte offset or length modification, otherwise AID issues an error message. Only by combining the address selection (%@) with the pointer operator (->) can you switch to machine code level, on which the area comprises the area of virtual memory occupied by the loaded program.

Example: %MOVE CITEM.3%L5 INTO CITEM
This command is rejected by AID on account of a violation of the CITEM area. The variables CITEM and CITEM1 each occupy 5 bytes. The last 2 bytes of CITEM as well as the 3 following bytes are to be transferred to CITEM1. The command should read: %MOVE %@(CITEM)->.3%L5 INTO CITEM1

%@(...)

With the address selector you can use the address of a data entry, a data item, a special register or a complex memory reference as sender. The address selector produces an address constant as a result (see AID Core Manual (Related publications) [1]). The address selector cannot be used for constants, which also include statement names, source references and figurative constants.

%L(...)

With the length selector you can use the length of a data entry, a data item or a special register as sender. The length selector produces an integer as a result (see AID Core Manual (Related publications) [1]).
Example: %MOVE %L(ITEM1) INTO %0G
The length of ITEM1 will be transferred.

%L=(expression)

The length function enables you as sender to calculate a value. expression is formed from the contents of memory references, constants, integers and arithmetic
operators. Only memory reference contents which are integers (type %F or %A) are permitted. The length function produces an integer as a result (see AID Core Manual (Related publications) [1]).
Example: %MOVE %L=(ITEM1) INTO %0G
The content of ITEM1 is transferred provided it is an integer (type %F), otherwise AID issues an error message.

AID literal

The following AID literals (see AID Core Manual (Related publications) [1]) can be transferred using %MOVE:

{C'x...x' | 'x...x' | U'x...x' }      Character literal
{X'f...f'}                            Hexadecimal literal
{B'b...b'}                            Binary Literal
n                                     Integer
#'f...f'                              Hexadecimalnumber 

rep

Specifies whether AID is to generate a REP record after a modification has been
performed. With REP you deactivate the global setting for this command (see %AID command). If REP is not specified and there is no valid declaration in the %AID command, no REP record is created.

rep-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REP = {Y[ES] | NO}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

REP=Y[ES]

LMS correction statements (REPs) in SDF format are created for the update caused by the current %MOVE command. If the object structure list is not available, no correction statements are generated and AID will output an error message.
Also, if receiver is not located completely within one CSECT, or if sender is more than 3900 bytes in length, AID will output an error message and not write a REP record. To obtain REP records despite this, the user must distribute transfer operations over several %MOVE commands.

AID stores the REPs with the requisite LMS correction statements in a file with the link name F6. The MODIFY ELEMENT statement must then also be inserted for the LMS run. Ensure, therefore, that no other output is written to the file with link name F6.

If no file with link name F6 is registered (see %OUTFILE), the REP is stored in the file AID.OUTFILE.F6 created by AID.

REP=NO

No REPs are created for the current %MOVE command.

Examples

The following items and tables are defined in a COBOL program:

01    NUMB-TAB-1.
   02 QNTY-1 PIC 999 OCCURS 10 INDEXED BY I.
01    NUMB-TAB-2.
   02 QNTY-2 PIC S9(6) OCCURS 50 INDEXED BY J.
01    FIXDPOINT-TAB.
   02 FIXD-QNTY PIC S999V99 OCCURS 26.
01    CHAR PIC X(4).
01    INTG-QNTY PIC S9(7) BINARY.
  1. %MOVE QNTY-1 INTO QNTY-2
    No index has been specified for the two table elements: AID therefore transfers the entire table NUMB-TAB-1 to NUMB-TAB-2 in hexadecimal format and left-justified, without taking into account any subdivision into table elements.

  2. %MOVE 20 INTO INTG-QNTY
    AID writes a word containing the value 20 (X’00000014’) to the data item INTG-QNTY, which also occupies 4 bytes in the COBOL program.

  3. %MOVE 20 INTO FIXD-QNTY(5)
    N.B.: As in example 2, a word with the contents X’00000014’ is written to FIXD-QNTY(5), which of course makes no sense when a table element of the fixed-point number type is involved. To transfer value 20 to FIXD-QNTY(5), you will have to enter a %SET command (see %SET), which performs conversion prior to the transfer.

  4. %MOVE X'58F0C160' INTO CHAR REP=YES
    The contents of the data item CHAR are overwritten with the hexadecimal literal X’58F0C160’. A REP record is created for the correction and is stored in the file AID.OUTFILE.F6 or the file assigned to link name F6.