Hi,
The following Cobol routine takes an integer number of seconds
and then calls the PAUSE intrinsic with the correct real value.
(ps, its easier to invoke the pause command via the HPCICOMMAND intrinsic).
Rgds,
Tad.
Identification division.
PROGRAM-ID. CPAUSE.
Data division.
Working-storage section.
01 EXPONENT binary pic s9(9).
01 FRACTION binary pic s9(9).
01 STRG PIC X(20) value spaces.
Linkage section.
01 integer-seconds comp pic s9(9).
Procedure division using INTEGER-seconds.
begin-cpause.
move zero to EXPONENT
move INTEGER-seconds to FRACTION
if FRACTION < 1
then goback
end-if
perform until FRACTION >= %40000000
add 1 to EXPONENT
add FRACTION to FRACTION
end-perform
subtract %40000000 from FRACTION
subtract EXPONENT from 150 giving EXPONENT
multiply %40000000 by EXPONENT
add EXPONENT FRACTION giving return-code
call intrinsic "PAUSE" using return-code
continue.
end-cpause.
goback.
END PROGRAM CPAUSE.
Internet
From: [log in to unmask] on 10/07/2000 17:04 GMT
Pour : HP3000-L
cc :
ccc: Tad BOCHAN
Objet : Re: [HP3000-L] Pause Intrinsic and Turbo Image Manual
The problem here is that there is no COBOL comp-1 or comp-2 USAGE items in the
PICTURE clause.
In the past, we wrote an SPL routine to do the conversion.
At our shop, we could use C ( C is COBOL without the OBOL ), but this option is
not open to all.
Of course, you could use hexadecimal PICTURE high order byte with a value
something like X'4000' (octal is more fun, though) and a lower value BINARY
field, all redefined to make it come out right.
Have not tried the HPCICOMMAND intrinsic for "PAUSE nnnn" from COBOL, but as
mentioned before, that SHOULD work.
>>> David Burney <[log in to unmask]> 07/10 9:47 AM >>>
Ooops. Aparently there is a Pause Intrinsic.
According to :
http://docs.hp.com/cgi-bin/doc3k/B3265090821.13550/192
The format is :
NM and CM callable
Suspends the calling process for a specified number of seconds.
Syntax :
32R
Pause (interval);
Interval 32-bit real by reference (required)
Passes the amount of time, in seconds
that the process pauses. The value of
interval must be positive. The maximum
time allowed is approximately
2,147,484 seconds (almost 25 days).
On Monday, July 10, 2000 1:15 PM, gts wrote:
: All,
:
: Can anyone give me the pause Intrinsic Syntax in Cobol, and does anyone
: know the easiest way to get a Turbo Image manual. Thanks
:
: Chris Miller
: Genesis Total Solutions, Inc.
----------------------------------------------------------------------------
-------
David Burney [log in to unmask]
Summit Racing Equipment http://www.summitracing.com
-----------
Does the phrase "To be quite honest..." mean that the person has
been less than honest before that point ?
-----------
All opinions expressed herein are my own and reflect,
in no way, those of my employer.
___________________________________________________________
This message and any attachments (the "message") are intended solely for
the addressees and are confidential. If you receive this message in error,
please delete it and immediately notify the sender.
Any use not in accord with its purpose, any dissemination or disclosure,
either whole or patial, is prohibited except formal approval.
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not therefore be liable for the message
if modified.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont
etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur.
Toute utilisation de ce message non conforme a sa destination, toute
diffusion ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse.
L'internet ne permettant pas d'assurer l'integrite de ce message, BNP
PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
___________________________________________________________
|