%META:TOPICINFO{author="ChrisBartram" date="1170385961" format="1.1" version="1.2"}% %META:TOPICPARENT{name="Hp3000ProgrammingFeatures"}% ---+ [[Hp3000CobolPause][How to call 'Pause' in COBOL on an HP3000]] I'm assuming you're on an XL system. Just call the COMMAND Intrinsic and pass it the MPE command PAUSE. --[[CharlesLeader]] Yes! From my stint at the HP Response Center (greetings to my former fellows!), I've got several sample COBOL routines to do this. Here's my favorite one, which uses HPEXTIN to convert a string to a REAL value: (much COBOLeez omitted)
WORKING-STORAGE SECTION.
01 string-num pic x(5) value "00005".
01 string-len pic s9(4) comp value 5.
01 decplaces pic s9(4) comp value 0.
01 datatype pic s9(4) comp value 1.
01 scale pic s9(4) comp value 0.
01 delims pic s9(4) comp value 0.
01 pause-value pic x(4) value "xxxx".
01 error1 pic s9(4) comp value 0.
01 d-error pic 9(5) value 0.
(somewhere in PROCEDURE DIVISION land )
CALL INTRINSIC "HPEXTIN" USING string-num, string-len,
decplaces, datatype, scale, delims, pause-value, error1.
if cc not equal zero
display "Error on HPEXTIN call"
move error1 to d-error
display "Error = " d-error
goback.
CALL INTRINSIC "PAUSE" USING pause-value.
To change the value, simply change the text in "string-num" to the number of seconds.
There are several examples of this on HP SupportLine as well.
--[[RichTrapp]]
Try this (from my infamous 3-ring binder:
{ Cute trick for PAUSE intrinsic:
{ 01 xx.
{ 03 high-word s9(4) comp value %040100.
{ 03 low-word s9(4) comp zero.
{ * Evaluates to x'40400000' or 1 second, +1077936128.
{ * For 5 seconds, +1083179008, x'40900000'.
--[[TonyShepherd]]
-- Main.ChrisBartram - 09 Jun 2006