midrange.com code scratchpad |
Name:
Execute QWCRSSTS 100 times (for timing purposes)
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
02/15/2010 07:07:59 am
|
IP:
Logged
|
|
Description:
It had been reported that execution of QWCRSSTS (Retrieve System Status) API from IBM can be a lengthy process. This program will execute that API 100 times, so that some idea of API time cost may be derived (in debug mode).
|
Code:
- D/Include QSYSINC/QRPGLESRC,QWCRSSTS
-
- D rtvssts PR ExtPgm('QWCRSSTS')
- D receiver Like(QWCS0100)
- D rcvrLength 10I 0 Const
- D formatName 8 Const
- D resetStats 10 Const
- D errorCode LikeDS(apiUSEC)
-
-
- D apiUSEC DS Qualified Inz
- D QUSBPRV 10I 0 Inz(%Size(apiUSEC))
- D QUSBAVL 10I 0
- D QUSEI 7
- D reserved 1
- D QUSED01 1024
-
-
- D I S 5U 0
- D timeStart S Z
- D elapsedSecs S 11P 3
-
-
- D myUSEC DS LikeDS(apiUSEC) Inz(*LikeDS)
-
- /Free
-
- timeStart = %TimeStamp() ;
- For I=1 to 100 ;
- rtvssts(qwcs0100: %Size(qwcs0100): 'SSTS0100': '*NO': myUSEC) ;
- EndFOR ;
- elapsedSecs = %Diff(%TimeStamp(): timeStart: *MS) / 1000000 ;
- *INLR = *On ;
- Return ;
-
- /End-free
|
|
|