The ANYTYPE parameter enables an import procedure to accept any kind of data item from the statement that invokes the procedure. ANYTYPE parameters are supported only in ALGOL and NEWP.
The matching export procedure must occur in a NEWP program, in a block marked as UNSAFE, with the parameter declared as type WORD. Otherwise, when the import procedure is invoked, an error occurs and the system displays the following message:
Object <procedure name>: Type or parameter mismatch in interface <client library identifier> to library <library name>
The export procedure can examine the tag bits in the parameter to determine the actual data type that was passed.
The ANYTYPE parameter is typically used for accessing certain operating system procedures that accept multiple data types. An example of such a procedure is the MCPSUPPORT procedure CHECKPOINTARRAY, which is described in Restarting Jobs and Tasks.
The following is an example of a client program with an import procedure that uses the ANYTYPE parameter:
BEGIN LIBRARY L (LIBACCESS = BYFUNCTION, FUNCTIONNAME = “TESTSUPPORT.”); PROCEDURE TESTPROC (W); ANYTYPE W; LIBRARY L; INTEGER I; EBCDIC ARRAY EBTEST[0:99]; REAL ARRAY RTEST[0:99,0:99]; TESTPROC(I); TESTPROC(EBTEST); TESTPROC(RTEST); END.
In this example, import procedure TESTPROC is declared with parameter W of type ANYTYPE. The program invokes procedure TESTPROC three times, passing a different type of data item to parameter W each time.

