IBM Support

How to Call the Machine Interface Library Function (MI) WAITTIME Using a ILE CL Program

Troubleshooting


Problem

This document explains how to call the Machine Interface Library Function 'waittime' using a CLLE program.

Resolving The Problem

Disclaimer: This is an example only. IBM accepts no responsibility for its correctness.


The waittime function causes the current process to be placed in a wait state for the amount of time specified by the wait interval in accordance with the specified wait options.

For the first parameter, you have the _MI_Time * wait_interval. The _MI_Time is an unsigned value of 4096000000. The wait_interval is the number of seconds you would like to wait. For my example, I took 4096000000 and multiplied it by 15 seconds to get a value of 61440000000. This number in hex is X'0000000E4E1C0000'.

The second parameter must have the value of hex X'0000'. The &OPTIONS can be larger. When calling 'waittime', you must pass the second parameter by value.

PGM
DCL VAR(&TIME) TYPE(*CHAR) LEN(8) VALUE(X'0000000E4E1C0000')
DCL VAR(&OPTIONS) TYPE(*CHAR) LEN(2) VALUE(X'0000')
DMPCLPGM
CALLPRC PRC('waittime') PARM(&TIME (&OPTIONS *BYVAL))
ENDPGM            

Note: The procedure name is 'waittime' which has to be in lower case.

To compile this on R610, you can issue a CRTBNDCL command or select 14 in PDM and it will compile. Note: On R610, we added functionality where the CL compiler automatically pulls in most of the IBM service programs. On a R540 system, you must issue a CRTCLMOD command or select 15 in PDM to compile it and then issue the CRTPGM command, binding it with service program QSYS/QC2UTIL1

Refer to the following URL for WAITTIME documentation in the R610 Information Center:
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/books/sc092418.pdf

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

517234485

Document Information

Modified date:
11 November 2019

UID

nas8N1013117