You can call ARCHIVE from user programs by means of the ARCHIVE macro. The statements in the macro are specified in the same way as in interactive mode (free string format). However, the HELP, PARAM and END statements are not permitted. In the macro, the parameters can be specified with their own operands.
ARCHIVE |
address,length[,MF = L / (E,opadr) / (E,(1)) ] ,CNS = YES / NO ,RES = YES / NO ,UNL = NO / YES ,OP = {NO / YES ,WRCHK = NO / YES ,SNR = YES / NO ,DEST = NO / YES ,CATID = NO / YES ,STREAM = YES / NO ,OLS = NO / YES |
address
Symbolic address of the ARCHIVE statement.
length
Length of the ARCHIVE statement.
MF
An operand list is generated.
For a description see the manual “Executive Macros” [5].
The operands of the ARCHIVE macro are similar to those of the PARAM statement; there are only a few operands which do not have the same names as in the PARAM statement, namely: RES stands for RESTART, UNL for UNLOAD, OP for OPERATOR and DEST for DESTROY.
Return codes and error flags
Register 1 is overwritten.
The rightmost byte of register 15 contains the return code (RC), and the remaining bytes are deleted.
RC | Meaning |
X'00' | The statement was executed without errors. |
X'10' | The statement was executed with warnings. |
X'20' | The statement was executed with errors. |
X'40' | Execution of the statement was not completed after an error. |
X'80' | The statement was rejected due to an error. |
X'81' | The address list was entered incorrectly or the statement is invalid; execution was not started. |
X'FF' | ARCHIVE is not loaded. |
Job switches are not set when ARCHIVE is called via the ARCHIVE macro.
Example
(1) | In the ARCHIVE macro, the operands |
(2) | One FILES statement and one SAVE statement are defined at the address |
(3) | The program that was, for example, stored in a library as the element /START-EXECUTABLE-PROGRAM FROM-FILE=*LIBRARY-ELEMENT(LIBRARY=$TEST.MACEXMP.LIB, ELEMENT-OR-SYMBOL=ARCHIVE) or, in abbreviated form: /SRX LIB=$TEST.MACEXMP.LIB,ELEM=ARCHIVE |