1

We can use SHOW command to display NAME, CPUTIME, IOTIME, READYQTIME, INITPBITTIME in WFL or Cande (Unisys mainframe). Is there any way to use this SHOW command in Unisys cobol 85 program to figure out how much CPUTIME or IOTIME my program is taking.

SHOW MIX NAME, CPUTIME, IOTIME, READYQTIME, INITPBITTIME

MixNo-CPUTime---IOTime---ReadyQTime-InitPBit---Name-----------

8465 14:32 :00 1:17 :00 NOTHING ON DISK

8411 2:35 :04 :45 :06 SYSTEM/TESTIT

8438 1:14 :01 :24 :09 SYSTEM/LCF

8441 1:05 :00 :24 :02 *SYSTEM/COMS

My program:

IDENTIFICATION DIVISION. ...

PROCEDURE DIVISION. ...

"I have to use Show command here to display CPUTIME or IOTIME"

...

Frank Boyne
  • 4,400
  • 23
  • 30
ashu
  • 11
  • 1

3 Answers3

0

You can probably use

CALL SYSTEM WFL USING literal-1
                      identifier-1

But that is from a quick glance through the Unisys COBOL-74 manual. Not sure if it still applies, but I'm betting, yes.

Brian Tiffin
  • 3,978
  • 1
  • 24
  • 34
0

If you want to simulate the CANDE SHOW command, you would use ASERIES_INFO to get the PMIX information. That can get involved, so it would help to know if you want to get this info for other tasks, or the task in which you are running.

If you want to access the CPU time of your own program, then use ATTRIBUTE ACCUMPROCTIME of MYSELF. Same goes for ACCUMIOTIME (both documented in the TASK Attributes Manual. Something like MOVE ATTRIBUTE ACCUMPROCTIME OF MYSELF TO WS-CPUTIME. would give you the CPUTime of your program.

Note that attribute is given in ticks (2.4 microseconds) except in WFL where it is in seconds.

Tom Schaefer
  • 181
  • 1
  • 7
0

IF you want to gather that information about your own program you don't want to use the SHOW command you want to access Task Attributes. See the Unisys Task Attributes Programming Reference Manual e.g., pdf for descriptions of all the available Task Attributes that can be retrieved. Some can also be modified.

See the Unisys COBOL ANSI-85 Programming Reference Manual, Volume 1: Basic Implementation e.g., pdf for information on manipulating Task Attributes - especially the MYSELF and MYJOB reserved words.

My COBOL is more than a little rusty and I don't have a convenient system to test on but the following is mostly cribbed from the manual anyway so it shouldn't be too far off.

IDENTIFICATION DIVISION. 
ENVIRONMENT DIVISION. 
DATA DIVISION. 
WORKING-STORAGE SECTION.  
01 WS-NAME         PIC X(50).
01 WS-INITPBIT     PIC 9(11) BINARY. 
PROCEDURE DIVISION. 
MAIN SECTION. 
MAIN-PARA.          
    MOVE ATTRIBUTE NAME OF MYSELF TO WS-NAME.     
    DISPLAY WS-NAME.   

    MOVE ATTRIBUTE INITPBITTIME OF MYSELF TO WS-INITPBIT.     
    DISPLAY WS-INITPBIT.  

    MOVE ATTRIBUTE INITPBITTIME OF MYJOB TO WS-INITPBIT.     
    DISPLAY WS-INITPBIT.

    IF MYSELF.OTHERPBITTIME > 100     
       --- etc ---
STOP RUN.
Frank Boyne
  • 4,400
  • 23
  • 30