Author: steve-myers
Subject: Re: Reply to: Get system time in micro second or clock uint.
Posted: Wed Sep 07, 2016 6:35 am (GMT 5.5)
Both the raw data and Mr. O'Boyle's proposed quad word are pretty useless without a lot of additional massaging.
The primary advantage of TIME MIC is the macro can be persuaded to convert the clock value to local time. This is not terribly difficult to do yourself, but it's one less thing you have to do, and you do not have to do some research (or beg someone here to give you the code).
Subject: Re: Reply to: Get system time in micro second or clock uint.
Posted: Wed Sep 07, 2016 6:35 am (GMT 5.5)
Bill O'Boyle wrote: |
Take a look at the TIME Macro (LINKAGE=SYSTEM) using the MIC (Microseconds) keyword. You can then return the binary-value 'as-is' or convert this binary-doubleword to a PL16 packed-decimal value, using the 'CVDG' (Convert Decimal Grande) instruction, with the doubleword loaded into a grande-register beforehand via a 'LG' (Load Grande) instruction. This type of sub-program can be used in both Batch and CICS. But, ensure you're passing re-entrant storage from the COBOL caller so that it remains re-entrant, which is a requirement in CICS. HTH.... |
Both the raw data and Mr. O'Boyle's proposed quad word are pretty useless without a lot of additional massaging.
Code: |
THE RAW TOD CLOCK IS D14F0580 A6DE7000 IN DECIMAL IT IS -3364464346508922880 |
The primary advantage of TIME MIC is the macro can be persuaded to convert the clock value to local time. This is not terribly difficult to do yourself, but it's one less thing you have to do, and you do not have to do some research (or beg someone here to give you the code).