Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

%SET

&pagelevel(3)&pagelevel

With the %SET command you transfer the memory contents or AID literals to memory positions in the program which has been loaded. Before transfer, the storage types sender and receiver are checked for compatibility. The contents of sender are matched to the storage type of receiver, with the result that the %SET statement works in the same way as the COBOL MOVE statement, apart from exceptions mentioned later.

  • With sender you designate a data item, a length, an address, an execution counter, an AID register, a COBOL special register, a figurative constant or an AID literal. sender may be either within the 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 to be overwritten. receiver may only be located within the virtual memory of the program which has been loaded.

Command Operand
%S[ET]sender INTO receiver

In contrast to the %MOVE command, AID checks for the %SET command (prior to transfer) whether the storage type of receiver is compatible with that of sender and whether the contents of sender match its storage type. In the event of incompatibility, AID rejects the transfer and outputs an error message.

If sender is longer than receiver, it is truncated on the left or right, depending on its storage type, and AID issues a warning message. sender and receiver may overlap. In the case of numeric transfer, sender is converted to the storage type of receiver if required, and the contents of sender are stored in receiver with the value being retained. If the value does not fully fit into receiver, a warning is issued.

sender and receiver may also be defined in the FILE SECTION or SUB-SCHEMA SECTION. If they are located in the LINKAGE SECTION, the latter must be contained in the current call hierarchy.

Which storage types are compatible and how transfer takes place is shown in the table at the end of the description of the %SET command.

Entry of the command immediately after loading the program is not advisable 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, you can also use those described in the manual for debugging on machine code level (see manual AID - Debugging on Machine Code Level (Related publications) [2]).

With %AID CHECK=ALL you can activate an update dialog; this dialog shows you the old and new contents of receiver prior to transfer and offers the option of aborting the %SET command.

The %SET command does not alter the program state.

sender
INTO

receiver

For sender or receiver you may specify data items, COBOL special registers, execution counters, registers or a complex memory reference. Statement names, source references, figurative constants, AID literals and addresses and lengths of data items can only be used as sender.
sender may be located either in the virtual memory area of the loaded program (E=VM) or in a dump file; receiver, on the other hand, may only be located in the virtual memory area of the loaded program.
If program areas are transferred or overwritten with instruction code, there may be undesirable results if addresses are affected which belong to a control-area or trace-area or for which a test point has been set with %INSERT (see AID Core Manual (Related publications) [1]).

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 only 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

is to be specified only if the current base qualification (see %BASE command) is not to apply to sender or receiver.
sender can be located either in virtual memory or in a dump file, whereas receiver must be located in virtual memory.

S=srcname

is to be specified only 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” (Symbolic memory references)), only a compl-memref.

C=segmentname

Without a length modification, specify the entire segment as the sender or receiver.

C=sharename

Without a length modification, specify the entire object module as the sender or receiver.

dataname

is the name of a group item or data element defined in the source program or the name of a COBOL special register. Figurative constants can only be used as sender.dataname is an alphanumeric string with up to 30 characters.

AID transfers data elements in accordance with the rules for COBOL MOVE, taking into consideration the definitions from the source program.
Data items can only be processed with %SET if both sender and receiver have been defined as data items. AID executes an alphanumeric transfer, taking neither the format nor the data type definition into account.
Numeric and alphanumeric receive items with print editing can only be modified with an AID character literal (C’...’, X’...’ or B’...’) whose contents have already been correspondingly edited for printing.

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

identifier

If dataname is not unambiguous within a program unit, it can be identified by being assigned to a particular data 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 only outputs data for 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

If dataname is the name of an element in a table, it can be indexed and subscripted as in a COBOL statement. The notation differs from COBOL only in that multiple indexes must be separated by a comma. If you specify the name of a table element without an index or with an incomplete index, AID aborts transfer.
index can 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 %SET 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 statement. 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 6 and 7.

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. m is specified only if the same COBOL verb appears more than once in a line.

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 6 and 7.

keyword

is an execution counter, the program counter or a register. Only a base qualification can be specified before keyword.
The AID Core Manual (Related publications) [1], lists the implicit storage types of the keywords.

%•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

The following operations may occur in compl-memref (see AID Core Manual (Related publications) [1]):

  • byte offset (•)

  • indirect addressing (->)

  • type modification (%T(dataname), %X, %C, %E, %D, %P, %F, %A, %S, %SX, %UTF16)

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

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

  • character conversion functions %C() and %UTF16()

With an explicit type or length modification you can match the storage type for sender to that of receiver. A type modification with a storage type that is incompatible with the memory contents will be rejected by AID.
If a compl-memref begins with 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 ( -> ), statement-name and source-reference can be used anywhere where hexadecimal numbers can be written.
Following a byte offset (•) or pointer operation (->), the implicit storage type and original address length are lost. At the calculated address, storage type %X with a length of 4 applies unless the user has made an explicit specification for type and length. Nevertheless, the area boundaries of a start address (CSECT, dataname, keyword etc.) remain in effect.
They must not be exceeded for any operand in a complex memory reference by a byte offset or length modification, otherwise AID will reject the command and issue an error message. Only by combining the address selector (%@) 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: %SET CITEM.3%L5 INTO CITEM1

The area of CITEM is five bytes long. After the byte offset, the area of CITEM would be exceeded by three bytes as a result of length modification %L5. This is not allowed. If it is intended to use the %SET command to transfer a further three bytes to CITEM1 after CITEM, the %SET must be written as follows:

%SET %@(CITEM)->.3%L5 INTO CITEM

%@(...)

With the address selector you can output the start address of a data entry, a data item, a special register or a complex memory reference. The result supplied by the address selector is an address constant (see AID Core Manual (Related publications) [1]).
The address selector cannot be used for symbolic constants (including the statement names, the source references and the figurative constants).

%L(...)

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

%L=(expression)

With the length function you, as sender, can have a value calculated.
expression is formed from memory references, constants, integers and arithmetic operators. Only memory reference contents that 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: %SET %L=(ARRAY1) INTO %0G The content of ARRAY1 is transferred if it is an integer (type %F). Otherwise AID issues an error message.

%C(...) or %UTF16(...)

This function converts strings from 1-byte EBCDIC encoding to UTF16 encoding and vice versa.
For further information, see the AID Core Manual (Related publications) [1].

AID literal

All AID literals described in the AID Core Manual (Related publications) [1], may be specified. Note well the conversion options for matching AID literals to the respective receivers as described in that chapter:

{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
[{+|-}]n.m                            Fixed-point number
[{+|-}]mantisseE[{+|-}]exponent       Floating-point number


%SET table

The following table provides an overview on permissible combinations of the sender and receiver types in conjunction with the %SET command.

sender

receiver

Fixed-pt.,
ext.float.-
pt.no,
subscript,
index,
special
register,
%D

int.
float.-
pt.no,
%F,
%P,
%A

Index1

alpha-
betic

alpha-
nume-
ric,

%C

edited

%X

%UTF16,
NATIO-
NAL

strongly
typed

Fixed-pt., ext.float.-pt.no,
subscript, index, 
special register, %D

num

num

num

−*

internal float.-pt.no,
ZERO,%F, %P, %A
[{±}]n,#' f...f'

num

num

num

−*

bin

[{±}]n.m
[{±}]mantE[{±}]exponent

num

num

−*

edited (alphabetic,
alpanumeric)

chara

char

*

chare

alphanumeric,
SPACE,QUOTE, %C

numn

numn

numn

chara

char

*

bin

chare

numeric edited.
HIGH- / LOW-VALUE

char

chare∗∗

symbolic character

numn

numn

numn

chara

char

*

chare

C' x...x'

numn

numn

numn

chara

char

char

bin

chare

X' f...f' , B' b...b'

bin

bin

bin

bin

bin

bin

bin

bin

%X

bin

bin

bin

bin

%UTF16/U’x...x’,
NATIONAL

numn

numn

numn

charae

chare∗∗∗

*

bin

charg

strongly typed

−*

−*

−*

−*

−*

chart

*

Unlike COLBOL, AID does not execute this transfer. 

**

When HIGH-VALUE/LOW-VALUE is transferred, conversion to NATIONAL takes place; this is not COBOL-compliant.

***

The transfer is forbidden in COBOL.

bin

Binary transfer; left-justified

sender < receiver padding with binary zeros on the right

sender > receiver truncation on the right

For transfer to %X, integral numeric literals correspond to a signed integer value
with a length of 4 bytes (%FL4), which are transferred in binary form.

char

Character transfer; left-justified or right-justified if the JUSTIFIED RIGHT clause of
sender is specified.

sender < receiver padding with blanks ’(...)’ on the side which is specified in
JUSTIFIED clause

sender > receiver truncation on the side which is specified in JUSTIFIED clause

a

Transfer only carried out if the contents of sender are alphabetic.

e

Conversion from/to National/%UTF16.

In the case of symbolic COBOL fields, the EBCDIC code set defined in the COBOL program is used if sender or receiver is not of the type NATIONAL/%UTF16.

The EBCDIC setting from the AID command is used in all other fields (of old COBOL programs, other programming languages or type %C). If a character in the sender coded character set or receiver coded character set is illegal, the substitute character ’.’  (period) in the coded character set of the receiver is transferred to the corresponding character position in the receiver without an AID message being issued.

g

If a group has the attribute GROUP-USAGE NATIONAL, the group behaves like a NATIONAL field.

tOnly if the receiver is of the same type.

num

Numeric transfer; value is retained

If required, sender is converted to the storage type of receiver.
The SIGN LEADING/TRAILING [SEPARATE] clause is taken into account.

n

If sender of the character type contains only digits and is no more than 31 digits long, AID performs numeric transfer.
If sender of the character type contains unlike digits, the transfer is not performed.

1Only values > 0 can be transferred in index.
AID performs the necessary conversion of table position number to table element displacement and vice versa.

-

No transfer

AID indicates the incompatibility of the storage types.

Examples

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

01    NUMB-TAB.
   02 QNTY          PIC S9(6) OCCURS 50 INDEXED BY J.
01    NUMB-SUM      PIC S9(6).
01    PROC-SUM      PIC S999V99.
01    CHAR          PIC X(10).
01    NATIONAL-CHAR PIC N(10)

For the following examples the update dialog was activated via %AID CHECK=ALL. This displays the contents of the receive field before and after the execution of %SET.

  1. %SET #'061' INTO NUMB-SUM

    OLD CONTENT:
              1
    NEW CONTENT:
             97
    %  AID9274 Change desired? (Y=YES; N=NO)?
    Y

    The following command produces the same result:
    %SET 97 INTO ANZ-SUMME

  2. %QUALIFY PROG=UPRONUM
    %SET .NUMB-SUM INTO .NUMB(16)

    OLD CONTENT:
              0
    NEW CONTENT:
             10
    %  AID9274 Change desired? (Y=YES; N=NO)?
    Y
  3. %SET 'ABCDEFG' INTO CHAR

    OLD CONTENT:
     1234567890
    NEW CONTENT:
     ABCDEFG
    %  AID9274 Change desired? (Y=YES; N=NO)?
    Y
  4. %SET 123.45 INTO PROC-SUM

    OLD CONTENT:
       +0.00
    NEW CONTENT:
     +123.45
    %  AID9274 Change desired? (Y=YES; N=NO)?
    Y
  5. %SET 123.45 INTO QNTY(5)

    I390 WARNING: SOURCE TRUNCATED
    OLD CONTENT:
         0
    NEW CONTENT:
       123
    %  AID9274 Change desired? (Y=YES; N=NO)?
    Y
  6. %SET L'OUTPUT' INTO %0G
    The address of the first instruction starting at paragraph PUTOUT is written into AID register %0G.
  7. %DA 5 FROM L'PUTOUT'->
    %SET L'PUTOUT'->%L2 INTO %1G
    With DISASSEMBLE you disassemble the instruction code located at the address allocated to the paragraph PUTOUT. The first instruction is a 2-byte instruction.
    This first instruction is written to AID register %1G with the %SET command.
  8. %SET CHAR INTO NATIONAL-CHAR
    %SET '{ä}' INTO NATIONAL-CHAR
    In the first case the EBCDIC string from the ZEICHEN field is converted to UTF16
    encoding (corresponds to the COBOL data type NATIONAL). The converted string is transferred to the NATIONAL-ZEICHEN field. The EBCDIC character set for CHAR from the COBOL program is used. This ensures that AID and the COBOL program perform the same conversions.
    In the second case the literal ’{ä}’ is transferred to the NATIONAL-CHAR field following UTF16 conversion. The literal ’{ä}’ can be input only if the terminal emulation supports the coded character set UTFE.

  9. %SET %UTF16(V'00' %CL3) INTO NATIONAL-CHAR
    %SET CHAR INTO NATIONAL-CHAR
    The function %UTF16() can only be applied to EBCDIC strings. Type modification with %C ensures that the memory address V’00’ is also interpreted as such.Both %SET commands convert an EBCDIC string contained in the memory to a UTF16 string. This is always stored in NATIONAL-CHAR.
    In the case of the %UTF16(V’00’ %CL3) operand, AID uses the character set selected by %AID EBCDIC . In the case of the CHAR operand, AID uses the character set specified by COBOL2000.
    You must consequently check the characters selected using %SHOW %AID. The EBCDIC character set currently selected is displayed.
    %D _EBCDIC_CCSN shows the character set that applies for the COBOL program.
  10. %SET NATIONAL-CHAR INTO CHAR
    %SET %C(V'00'%UTF16L6) INTO CHAR
    Both %SET commands convert a UTF16 string contained in the memory to an EBCDIC string and store it in CHAR.
    In the first case the COBOL2000 object determines the EBCDIC character set of the destination field. In the second case the %AID command determines the EBCDIC character set of the destination field.