-
Notifications
You must be signed in to change notification settings - Fork 6
/
rex100.txt
4444 lines (4294 loc) · 153 KB
/
rex100.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*REXX*/
numeric digits 15
totdif_DistTcb=0
totdif_DistSrb=0
/*-------------------------------------------------------------*/
/* Extract SMF 100 records - written by Nguyen Duc Tuan */
/* ndt.db2àgmail.com */
/* Developed and tested on DB2 V12 in Guyancourt, FRANCE */
/* 4 jan 2016 Release 1.1 */
/* 14 jan 2016 Release 1.2 add dsnqdst ddf stats */
/* 11 fev 2016 Release 1.2.1 correct imprecision */
/* on bp figures (numeric digits) */
/* 25 fev 2016 Release 2.0 Ifcid225 cur. threads */
/* vsm=Y option to calculate max thread */
/* possible + central storage usage */
/* 15 Apr 2016 Release 2.1 More displays for threads */
/* calculation - Verification OK with values */
/* from IBM Rexx MEMU */
/* 20 Apr 2016 Release 2.2 More columns for storage */
/* monitoring */
/* 03 Jul 2016 Release 2.3 Process Data Manager Section */
/* (DSNDQIST macro with difference) */
/* 06 Jul 2016 Release 2.4 Correction abend in TF=... */
/* when number of tasks = 0 */
/* Able to process records from several days */
/* 29 Jul 2016 Release 2.5 Minor fixes +Logs created */
/* 13 Oct 2016 Release 2.6 Add Q3ST stats */
/* (Signon, Terminate, Create Threads ..) */
/* and Datasets Stats */
/* 16 Dec 2016 Release 2.7 PageIns buffer Stats */
/* 02 Mar 2017 Release 3.0 Improve Bufferpool stats */
/* 21 Mar 2017 Release 3.1 More Bufferpools stats and */
/* warning messages */
/* 25 Apr 2017 Release 3.2 BP memory usage in Real and */
/* Auxiliary */
/* 11 May 2017 DSC stats (Full Prepare, Short, ...) Locks */
/* 24 May 2017 Z/OS Stats (must activate zparm) R3.4 */
/* 16 Aug 2017 Add BP simulated stats R3.5 */
/* 11 Oct 2017 Release 3.6 Add Workfile usage stats */
/* 02 Feb 2018 Release 3.7 Add more QISE stats (DBDsteal */
/* 02 Mar 2018 Group Buffer Pool stats + check */
/* 25 Sep 2018 More stats (GBP...) and correction */
/* 15 Nov 2018 Release 3.9 Correction error on QWSAPROC */
/* 19 May 2019 Release 4.0 More columns */
/* 10 Sep 2019 More alerts (Latch class ..) */
/* 19 Dec 2019 More alerts (Autobinds, Auth Cache) */
/* 23 Mar 2020 FTB & Inserts Algo 2 - V12 Async XI */
/* 11 Sep 2020 Corrections */
/* 07 Nov 2020 Display_Detail to have details on pagein */
/* 10 Feb 2021 Global Locks */
/* 11 MAr 2021 ChangeLock & Unlock - Async Global Lock (LK)*/
/* 25 May 2021 Correction bufferpools figures+ Zos stats */
/* 25 Jan 2022 More log manager stats */
/*-------------------------------------------------------------*/
/*Comment : Change datasets high level identifier */
/*-------------------------------------------------------------*/
ARG SSID hlq smforig Alert BpSim NoHead StatOnly
If NoHead ='NOHEAD' then NoHead=1
else NoHead=0
If StatOnly='STATONLY' then StatOnly=1
else StatOnly=0
retcode=0
/* Display Warning messages (best practices)*/
if Alert ='' then Alert='Y'
/* Bufferpool simulation */
if BpSim <> 'Y' then BpSim='N'
/* Virtual storage monitoring Yes/No */
VSM='Y'
say ' '
say 'Processing for Subsys' ssid
ifcid1_seen=0
if smforig='' then smforig='A'
if smforig='A' then
do
/* Input file : SMF extract sorted */
oufl = hlq !! '.SMFEXTS.OUT'
"ALLOC DD(INP) DS('"oufl"') ,
SHR REU bufno(20)"
end
/* Report dataset on output (general stats) */
oufl = "'" !! hlq !! '.reports.' !! ssid'.S01' !! "'"
x=OUTTRAP(TMP.)
"DELETE" oufl "PURGE"
x=OUTTRAP(OFF)
/* Report dataset on output (BP stats) */
oufl2= "'" !! hlq !! '.reportsb.' !! ssid !! '.CSV' !! "'"
x=OUTTRAP(TMP.)
"DELETE" oufl2 "PURGE"
x=OUTTRAP(OFF)
/* Report dataset on output (GBP stats) */
oufl5= "'" !! hlq !! '.reportsg.' !! ssid !! '.CSV' !! "'"
x=OUTTRAP(TMP.)
"DELETE" oufl5 "PURGE"
x=OUTTRAP(OFF)
/* Report dataset on output (STOR stats) */
oufl3= "'" !! hlq !! '.reportst.' !! ssid !! '.CSV' !! "'"
x=OUTTRAP(TMP.)
"DELETE" oufl3 "PURGE"
x=OUTTRAP(OFF)
/* Report dataset on output (BP Simulation stats) */
oufl4= "'" !! hlq !! '.repSimBP.' !! ssid !! '.CSV' !! "'"
x=OUTTRAP(TMP.)
"DELETE" oufl4 "PURGE"
x=OUTTRAP(OFF)
"ALLOC FI(OUFL) DA("oufl") NEW CATALOG REUSE" ,
"lrecl(1800) RECFM(V B) TRACKS SPACE(200,200)"
RcAlloc = rc
if RcAlloc <> 0 then Do
say "**********************************************"
say " Error allocating report file" oufl RcAlloc
say " Abnormal end "
say "**********************************************"
Exit 8
end
if ç StatOnly then
do
"ALLOC FI(OUFL2) DA("oufl2") NEW CATALOG REUSE" ,
"LRECL(500) RECFM(V B) TRACKS SPACE(50,50)"
RcAlloc = rc
if RcAlloc <> 0 then Do
say "**********************************************"
say " Error allocating report file" oufl2 RcAlloc
say " Abnormal end "
say "**********************************************"
Exit 8
end
"ALLOC FI(OUFL5) DA("oufl5") NEW CATALOG REUSE" ,
"LRECL(130) RECFM(V B) TRACKS SPACE(50,50)"
RcAlloc = rc
if RcAlloc <> 0 then Do
say "**********************************************"
say " Error allocating report file" oufl5 RcAlloc
say " Abnormal end "
say "**********************************************"
Exit 8
end
"ALLOC FI(OUFL3) DA("oufl3") NEW CATALOG REUSE" ,
"LRECL(200) RECFM(V B) TRACKS SPACE(10,10)"
RcAlloc = rc
if RcAlloc <> 0 then Do
say "**********************************************"
say " Error allocating report file" oufl3 RcAlloc
say " Abnormal end "
say "**********************************************"
Exit 8
end
if BPSim = 'Y' then
do
"ALLOC FI(OUFL4) DA("oufl4") NEW CATALOG REUSE" ,
"LRECL(200) RECFM(V B) TRACKS SPACE(90,15)"
RcAlloc = rc
if RcAlloc <> 0 then Do
say "**********************************************"
say " Error allocating report file" oufl3 RcAlloc
say " Abnormal end "
say "**********************************************"
Exit 8
end
end
end /* StaOnly */
/* init counters */
call init_var
/* WRITE report header */
if ç NoHead then
Call WriteHeader
/* START PROCESSING */
DO FOREVER
/* read SMF record one by one */
"EXECIO 1 DISKR INP"
IF RC > 0 THEN DO
if rc = 2 then
do
SAY 'End of input SMF file rc=' RC
RcAlloc = rc
end
else do
SAY 'Error while reading SMF file rc=' RC
RcAlloc = 8
end
leave
END
PARSE PULL InpRec
reci=reci+1
Ofs = 1
/* Decode SMF header */
CALL DSNDQWST
if result > 0 then iterate
/* Process only SMF100 */
/* record SMF records period */
if min_time > run_fmt_time then min_time=run_fmt_time
if max_time < run_fmt_time then max_time=run_fmt_time
if min_date > sm100dte then min_date=sm100dte
if max_date < sm100dte then max_date=sm100dte
/* Save offset_self to reuse later */
OfsSelf= Ofs
/* go thru Self Def. section to go to Prod section*/
Ofs = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs - 4 + 1
/* Process Product section*/
CALL DSNDQWHS
Ofs=OfsSelf
/* IFCID 1 must start the stats group */
if ifcid = 1 then
do
ifcid1_seen = 1
end
else if ifcid <> 1 & ifcid1_seen = 0 then
do
iterate
say 'Bypass' ifcid
say 'Ifcid 1 must start the group'
end
recs=recs+1
/* record ifcid in this smf data */
call record_ifcid
Select
When ifcid = 1 Then do
CALL DSNDQWS0
Ofs = QWS00PSO - 4 + 1
end
When ifcid = 2 Then do
CALL DSNDQWS1
Ofs = QWS10PSO - 4 + 1
end
/* When ifcid = 199 Then do
CALL QW0199
Ofs = QWS10PSO - 4 + 1
end */
When ifcid = 225 Then do
CALL QW0225
Ofs = QWS10PSO - 4 + 1
end
Otherwise do
/* add line here to avoid excessive displays */
/* 202 System param. attributes */
/* 230 DataSharing Global stats */
if ifcid = 202 then nop
else
if ifcid = 230 then nop
else
say 'ifcid ' ifcid ' not processed'
end
end /* select */
/*write report when all IFCID processed */
if ifcid = 1 & recs > 1 then
do
call ifcid_diff
Call write_report
end
else
do
if ifcid = 1 & recs = 1 then
do
Old_Mstrtcb = Mstrtcb
Old_MstrSrb = MstrSrb
Old_MstrpSRB= MstrpSRB
Old_MstrpSRB_ziip = MstrpSRB_ziip
Old_dbm1Tcb = dbm1Tcb
Old_dbm1srb = dbm1srb
Old_dbm1pSRB= dbm1pSRB
Old_dbm1pSRB_ziip = dbm1pSRB_ziip
Old_irlmTcb = irlmTcb
Old_irlmsrb = irlmsrb
Old_irlmpSRB= irlmpSRB
Old_irlmpSRB_ziip = irlmpSRB_ziip
Old_DistTcb = DistTcb
Old_Distsrb = DistSrb
Old_DistpSRB= DistpSRB
Old_DistpSRB_ziip = DistpSRB_ziip
end
end
END
/* close file */
address TSO "EXECIO 0 DISKW OUFL (FINIS"
rcwrite = rc
if rcwrite<> 0 then Do
say "**********************************************"
say " Error writting OUFL file: " rcwrite
say " Abnormal end "
say "**********************************************"
Exit 8
end
"EXECIO 0 DISKR INP (FINIS"
"FREE DD(INP)"
"FREE DD(OUFL)"
/* report ifcid read */
call report_ifcid
say "Total DistTcb=" totdif_DistTcb
say "Total DistSrb=" totdif_DistSrb
say ""
say "Input records =" reci
say "Output records=" reco
say 'SMF period : ' min_date "/" max_date min_time "/" max_time
/*-------------------------------------------------*/
/* F20 End of program display counters and figures */
/*-------------------------------------------------*/
call DispVStor
EXIT retcode
/*---------------------------------------*/
/* End of program body- Routines section */
/*---------------------------------------*/
/* MAP SELF-DEFINING SECT IFCID 001 LG = 112 */
DSNDQWS0:
/* OFFSET TO THE PRODUCT SECTION */
QWS00PSO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 4
QWS00PSL = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
QWS00PSN = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
/* Following sections are provided by DSNDQWST (Stats header) */
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQWSA CPU TIME */
QWS00R1O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 4
QWS00R1L = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
QWS00R1N = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
SvOfs = Ofs
/* controle de coherence */
if QWS00R1N > 4 then
do
say 'QWS00R1N is not equal to 4, abnormal end ' QWS00R1N
exit 8
end
/* Load offset to DSNDQWSA section - decode db2 stc cpu section */
Ofs= QWS00R1O - 3 /* -4 +1 */
i=0
/* init DIST - DIST stats not always present */
DISTTcb = 0
DISTSrb = 0
DISTpSRB = 0
DISTpSRB_Ziip= 0
do until i= QWS00R1N
i = i+ 1
call DSNDQWSA
end
/*restore offset */
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQWSB STATS COUNTERS*/
/* INSTRUMENTATION STATISTICS DATA ABOUT OUTPUT DESTINATION */
QWS00R2O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQWSC */
/* IFCIDS RECORDED TO STATISTICS */
QWS00R3O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQ3ST */
/* Subsytem services fields */
/* SIGNON, IDEN, COMMITS, ABORTS ...*/
QWS00R4O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00R4O - 3
call DSNDQ3ST
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQ9ST */
QWS00R5O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQWSD */
/* CHECKPOINT INFO, IFI COUNT ...*/
QWS00R6O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00R6O - 3
call DSNDQWSD
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQVLS */
/* LATCH COUNTS ...*/
QWS00R7O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00R7O - 3
call DSNDQVLS
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQVAS */
/* ASMC STATS NBRE DE SUSPENSIONS ..*/
QWS00R8O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQSST */
/* STORAGE MANAGER */
QWS00R9O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00R9O - 3
call DSNDQSST
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQLST */
/* DDF STATS BY LOCATION */
QWS00RAO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 4
QWS00RAL= C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 4
SvOfs = Ofs
Ofs = QWS00RAO - 3
if QWS00RAO > 0 then
call DSNDQLST
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQJST */
/* LOG MANAGER */
QWS00RBO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00RBO - 3
call DSNDQJST
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQDST */
/* DBAT STATS */
QWS00RCO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
Ofs = QWS00RCO - 3
call DSNDQDST
Ofs = SvOfs
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQWOS */
/* ZOS STATS */
QWS00RDO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
SvOfs = Ofs
if QWS00RDO > 0 then
do
Ofs = QWS00RDO - 3
call DSNDQWOS
Ofs = SvOfs
end
else do
QWOSLPRU=0
QWOSDB2U=0
QWOSLPIR=0
QWOSDPIR=0
QWOSLRST=0
QWOSLRSF=0
QWOSDRSU=0
QWOSLUIC=0
end
/* LG = 112 = 14 SECTIONS * 8 */
Return
QW0225:
numeric digits 15
/* offset_save=Ofs save offset begin data section*/
/* Ofs = offset of self definition section*/
/* Ofs = Ofs + 8 : bypass pointer to Product Section*/
/* OfsD = offset Data section */
Ofs =Ofs +8 /*pointer to data section 1 4+2+2 */
/*take the contents pointed by the offset */
OfsD= C2D(SUBSTR(InpRec,Ofs,4))
/* -------------- */
/* data section 1 */
/* -------------- */
/* Data section 1 = 2 parts, DBM1 and DIST */
/* offset to dbm1 */
OfsD=OfsD -4+1
Ofs=Ofs+4
/* say 'offs sect1' OfsD */
/* len of data section 1 : it will be repeated :*/
/* One for DBM1 and one for DIST */
len= C2D(SUBSTR(InpRec,Ofs,2))
Ofs=Ofs+2
rep= C2D(SUBSTR(InpRec,Ofs,2))
Ofs=Ofs+2
/* say 'len' len
say 'rep' rep
say 'Inprec:' InpRec */
/* offset to DIST */
OfsD2=OfsD+len
/* say 'offs sect2' OfsD2 */
QW0225AN =(SUBSTR(InpRec,OfsD,4))
if QW0225AN <> 'DBM1' then
do
say 'W0225 - Mapping error'
exit 8
end
/***********************************/
/* Processing DBM1 storage section */
/***********************************/
if QW0225AN = 'DBM1' & vsm ='Y' then
do
OfsD=OfsD+4
/* extended region size */
QW0225RG = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+12
/* 31 bit low private */
QW0225EL = C2D(SUBSTR(InpRec,OfsD,4))
/* say '31bit low priv' b2mb(QW0225EL)*/
OfsD=OfsD+4
QW0225EH = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+12
/* storage reserved fo must complete */
/* before V10 depends on CTHREAD and MAXDBAT zparm*/
QW0225CR = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
/* storage reserved for open/close datasets */
/* depends on DSMAX value */
QW0225MV = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
QW0225SO = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
QW0225GS = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+8
QW0225VR = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
QW0225FX = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
QW0225GM = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
/* 31 bit storage available */
QW0225AV = C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+40
/* Number of real 4K frames in use for
31 and 64-bit private */
QW0225RL_dbm1 = C2D(SUBSTR(InpRec,OfsD,8))
/* Real stor. frame used by the Address Space*/
/* this includes bufferpools storage qw0225bb */
OfsD=OfsD+8
QW0225AX_dbm1 = C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8
/* QW0225HVPagesInReal 64 bits private Real */
/* HV = High Virtual */
QW0225HVPagesInReal = C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8
/* QW0225HVAuxSlots 64 bits private Aux */
QW0225HVAuxSlots = C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+24
/* /* QW0225HWM 64 bits private Real*/
QW0225HVGPagesInReal = C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8
/* QW0225HWM 64 bits private Aux */
QW0225HVGAuxSlots= C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8 */
/* QW0225PagesInReal 64 bits private Real without BP */
QW0225PriStg_Real= C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8
/* QW0225PagesInAux 64 bits private Aux without BP */
QW0225PriStg_Aux= C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+8
TotalRealUsedBP = QW0225HVPagesInReal - QW0225PriStg_Real
TotalAuxUsedBP = QW0225HVAuxSlots - QW0225PriStg_Aux
end /* if QW0225AN = 'DBM1' & vsm = 'Y' then */
/* rep = 2 : there is 2 parts , DBM1 and DDF */
if rep = 2 then
do
/* DIST section */
QW0225AN =(SUBSTR(InpRec,OfsD2,4))
if QW0225AN <> 'DIST' then
do
say 'W0225 - Mapping error DIST not found'
exit 8
end
if QW0225AN = 'DIST' & vsm='Y' then
do
OfsD2=OfsD2+ 104
QW0225RL_Dist = C2D(SUBSTR(InpRec,OfsD2,8))
OfsD2=OfsD2+8
QW0225AX_Dist = C2D(SUBSTR(InpRec,OfsD2,8))
end /* if QW0225AN = 'DIST' & vsm = 'Y' then */
end
else /*if rep = 2 then*/
do
QW0225RL_Dist = 0
QW0225AX_Dist = 0
end
/***************************/
/*pointer to data section 2*/
/* Thread information */
/***************************/
OfsD= C2D(SUBSTR(InpRec,Ofs,4))
OfsD=OfsD -4+1
QW0225AT =C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4 /*pointer on data section 2*/
QW0225DB =C2D(SUBSTR(InpRec,OfsD,4))
if (QW0225AT + qw0225DB) < MinThdSee then
do
MinThdSee = QW0225AT + qw0225DB
MinThdSeeTime= run_fmt_time
MinThdSeeDate= sm100dte
end
if (QW0225AT + qw0225DB) > MaxThdSee then
do
MaxThdSee = QW0225AT + qw0225DB
MaxThdSeeTime= run_fmt_time
MaxThdSeeDate= sm100dte
end
/* say 'threads allied=' QW0225AT
say 'threads dbat=' QW0225DB */
/********************************************************/
/* */
/*pointer to data section 3 : Shared and Common Storage */
/* */
/********************************************************/
Ofs = Ofs+8 /* go to next pointer*/
if vsm = 'Y' then
do
/* load address of section 3*/
OfsD= C2D(SUBSTR(InpRec,Ofs,4))
OfsD=OfsD -4+1
OfsD=OfsD +136
QW0225SHRINREAL =C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 32
QW0225ShrStg_Real=C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 8
QW0225ShrStg_Aux =C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 8
QW0225ShrStkStg_Real=C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 8
QW0225ShrStkStg_Aux =C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 8
QW0225ComStg_Real=C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD + 8
QW0225ComStg_Aux =C2D(SUBSTR(InpRec,OfsD,8))
/* TotalRealUsedByLPAR meaning not clear - value does not */
/* corresponds with others z/OS monitoring tool */
/* TotalRealUsedByLPAR= qw0225rl_dbm1+ qw0225rl_Dist +, */
/* QW0225ComStg_Real + -- in redbook but no where else*/
/* QW0225SHRINREAL */
/* QW0225ComStg_Real Real in use 64 bit shared */
/* QW0225SHRINREAL Real in use 64 bit common */
if MaxRealLPAR < TotalRealUsedByLPAR then
do
MaxRealLPAR = TotalRealUsedByLPAR
time_MaxRealLPAR = run_fmt_time
end
OfsD=OfsD + 40
QW0225_REALAVAIL =C2D(SUBSTR(InpRec,OfsD,4))
if MinQW0225_REALAVAIL > QW0225_REALAVAIL then
do
MinQW0225_REALAVAIL = QW0225_REALAVAIL
time_MinQW0225_REALAVAIL = run_fmt_time
date_MinQW0225_REALAVAIL = sm100dte
end
OfsD=OfsD + 40
QW0225_LMWrite_Real=C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD + 4
QW0225_LMWrite_Aux =C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD + 4
QW0225_LMCtrl_Real =C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD + 4
QW0225_LMCtrl_Aux =C2D(SUBSTR(InpRec,OfsD,4))
/* formula from Redbook V11 Monitoring */
/* table 13-1 13-2 */
/* Calculation to be updated in V11 + Log Mgr control */
/* in Real, Log. write buffers - Source MEMU Excel sheet */
TotalRealUsedByDB2 = qw0225rl_dbm1+ qw0225rl_Dist +,
QW0225ShrStg_Real + QW0225ShrStkStg_Real +,
QW0225ComStg_Real + QW0225_LMWrite_Real +,
QW0225_LMCtrl_Real
/* calculation updated in V11 + Log Mgr control */
/* in aux - check IBM excel provided with memu */
TotalAuxlUsedByDB2 = qw0225ax_dbm1+ qw0225ax_Dist +,
QW0225ComStg_Aux + QW0225ShrStg_Aux + ,
QW0225ShrStkStg_Aux + QW0225_LMCtrl_Aux +,
QW0225_LMWrite_Aux
If MaxDB2AuxUse < TotalAuxlUsedByDB2 then
do
MaxDB2AuxUse=TotalAuxlUsedByDB2
timeMaxDB2AuxUse=run_fmt_time
DateMaxDB2AuxUse=sm100dte
end
end
/*----------------------------*/
/* Pointer to data section 4 */
/* Statement Cache and */
/* shareable statement Detail */
/*----------------------------*/
Ofs=Ofs+8
/* Load address of section 4*/
OfsD= C2D(SUBSTR(InpRec,Ofs,4))
OfsD=OfsD -4+1
OfsD=OfsD+16
/*£ of dynamic SQL local cache statements in
64-bit agent local pools used by active
threads
(64-bit shared agent local variable pools) */
QW0225LC =C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
/* HWM of QW225LC */
QW0225HC =C2D(SUBSTR(InpRec,OfsD,4))
OfsD=OfsD+4
/* Storage requested for dynam SQL 64-bit shared agent local*/
QW0225L2=C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+16
/* Time of HWM */
/* QW0225HT=SUBSTR(InpRec,OfsD,8)
call stck QW0225HT
say timestamp run_fmt_time */
OfsD=OfsD+32
/* Allocated for dynam 64-bit shared system variable pools*/
QW0225SC8=C2D(SUBSTR(InpRec,OfsD,8))
OfsD=OfsD+16
/* Allocated for static 64-bit shared system variable pools*/
QW0225SX8=C2D(SUBSTR(InpRec,OfsD,8))
/*-------------------------------------------------*/
/*pointer to data section 5 : Pool storage details */
/*-------------------------------------------------*/
Ofs=Ofs+8
if vsm = 'Y' then
do
OfsD= C2D(SUBSTR(InpRec,Ofs,4))
OfsD= OfsD+4
/* QW0225AS Total system agent storage 31 bits*/
QW0225AS =C2D(SUBSTR(InpRec,OfsD,4))
/* QW0225BB Total buffer manager storage blocks */
/*-------------------------------*/
/* Calculate max threads allowed */
/*-------------------------------*/
/*Ici on a eu tous les infos on peut donc calculer le */
/* nombre de threads max theoriques*/
/* Source : IBM formula */
/* (Redbook V11 subsystem monitoring Chap. Virtual Stor*/
/* Min and Max is used in a very defensive way */
/* The excel proposed with MEMU deoesn't use min max */
/* I also caculate this value (thdcomp2) */
/* Thread footprint calculation : */
/* Basic Storage Cushion */
BC = QW0225CR + QW0225MV + QW0225SO
/* Non DB2 storage, retains max value for final calculation*/
ND = QW0225EH-QW0225GM-QW0225GS-QW0225FX-QW0225VR
if ND > MaxND then MaxND=ND
/* Max Allowable storage */
AS = QW0225RG-BC-MaxND
AS2= QW0225RG-BC-ND
if AS < MinAS then MinAS=AS
/* Max Allowable storage for thread use*/
TS = MinAS-(QW0225AS + QW0225FX + QW0225GM+ QW0225EL)
TS2= AS2-(QW0225AS + QW0225FX + QW0225GM+ QW0225EL)
if TS < MinTS then MinTS=TS
/* Average thread footprint */
/* qdstcnat and QW0225DB are identical */
if (QW0225AT + qdstcnat) = 0 then
/* if threads in system = 0 then 1 */
TF = QW0225VR- QW0225AS + QW0225GS
else
TF = (QW0225VR-QW0225AS+QW0225GS)/(QW0225AT+qdstcnat)
if TF > MaxTF then MaxTF=TF
/* Max threads supported */
ThdComp=MinTS/MaxTF
ThdComp2=TS2/TF
StorBefContract=qw0225AV-(qw0225cr+qw0225SO+qw0225MV)
/* Storage contraction ?*/
if qw0225AV < qw0225cr then
do
say ' Storage critical condition',
'à ' run_fmt_time
end
else do
if qw0225AV < (qw0225cr+ qw0225SO+qw0225MV) then
do
say ' Full system contraction should happen',
'à ' run_fmt_time
end
end /* else */
if ThdComp < MinThdComp then do
MinThdComp =ThdComp
MinThdCompTime=run_fmt_time
MinThdCompDate=sm100dte
end
if ThdComp2 < MinThdComp2 then do
MinThdComp2 =ThdComp2
MinThdComp2Time=run_fmt_time
MinThdComp2Date=sm100dte
end
if ThdComp > MaxThdComp then do
MaxThdComp =ThdComp
MaxThdCompTime =run_fmt_time
MaxThdCompDate =sm100dte
end
if ThdComp2 > MaxThdComp2 then do
MaxThdComp2 =ThdComp2
MaxThdComp2Time =run_fmt_time
MaxThdComp2Date =sm100dte
end
Real4K_dbm1=(QW0225RL_dbm1 *4096)/ 1048576 /*1MB*/
Real4K_Dist=(QW0225RL_Dist *4096)/ 1048576 /*1MB*/
If MinReal4K_dbm1 > Real4K_dbm1 then
do
MinReal4K_dbm1=Real4K_dbm1
time_MinReal4K_dbm1=run_fmt_time
Date_MinReal4K_dbm1=sm100dte
end
If MaxReal4K_dbm1 < Real4K_dbm1 then
do
MaxReal4K_dbm1=Real4K_dbm1
time_MaxReal4K_dbm1=run_fmt_time
Date_MaxReal4K_dbm1=sm100dte
end
If MinReal4K_Dist > Real4K_Dist then
do
MinReal4K_Dist=Real4K_Dist
time_MinReal4K_Dist=run_fmt_time
Date_MinReal4K_Dist=sm100dte
end
If MaxReal4K_Dist < Real4K_Dist then
do
MaxReal4K_Dist=Real4K_Dist
time_MaxReal4K_Dist=run_fmt_time
Date_MaxReal4K_Dist=sm100dte
end
end /* if vsm ... */
return
/* MAP SELF-DEFINING SECT IFCID 002 LG = 12X8 = 96 */
DSNDQWS1:
/* OFFSET TO THE PRODUCT SECTION */
QWS10PSO = C2D(SUBSTR(InpRec,Ofs,4))
Ofs= Ofs + 8
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQXST */
/* RDS stats block */
QWS10R1O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
if QWS10R1O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R1O - 4 + 1
call DSNDQXST
Ofs = SvOfs
end
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQTST */
/* Binds counts, Plans allocated succ ... */
QWS10R2O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
if QWS10R2O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R2O - 4 + 1
call DSNDQTST
Ofs = SvOfs
end
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQBST */
/* Buffer manager stats */
QWS10R3O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 4
QWS10r3L = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
QWS10r3N = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
/* decode dsndqbst to have buffer stats */
if QWS10R3O > 0 then
do
SvOfs= Ofs
Ofs=QWS10R3O - 4 + 1
call init_sum_bpstats
/*add code here if need figures by bufferpool ID */
m=0
do until m= QWS10r3N
m = m+ 1
call dsndqbst
end
call comp_sum_bpstats
/* Just read => Old bpstats */
call switch_bpstats
Ofs=SvOfs
end
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQIST */
/* Data manager stats */
QWS10R4O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
if QWS10R4O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R4O - 4 + 1
call DSNDQIST
Ofs = SvOfs
end
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQTXA */
/* Lock manager stats */
QWS10R5O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
if QWS10R5O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R5O - 4 + 1
call DSNDQTXA
Ofs = SvOfs
end
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQISE */
/* EDM Pool stats */
QWS10R6O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 4
QWS10R6L = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
QWS10R6N = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
if QWS10R6O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R6O - 4 + 1
call DSNDQISE
Ofs = SvOfs
end
/* Stop here if not BP Simul. */
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQBGL */
/* Group BufferPool stats */
QWS10R7O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 6
QWS10R7N = C2D(SUBSTR(InpRec,Ofs,2))
Ofs = Ofs + 2
if QWS10R7O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R7O - 4 + 1
call init_gbpstats
m=0
do until m= QWS10r7N
m = m+ 1
call DSNDQBGL
end /* do until */
call comp_diff_gbpstats
call switch_gbpstats
Ofs = SvOfs
end /* QWS10R7O > 0 */
/* OFFSET TO DSNDQTGS GLOBAL LOCKING STATISTICS */
QWS10R8O = C2D(SUBSTR(InpRec,Ofs,4))
Ofs = Ofs + 8
if QWS10R8O > 0 then
do
SvOfs = Ofs
Ofs = QWS10R8O - 4 + 1
call DSNDQTGS
Ofs = SvOfs
end
else do
QTGSLSLM=0
QTGSCSLM=0
QTGSUSLM=0
QTGSIGLO=0
QTGSSGLO=0
QTGSFLSE=0
QTGSKIDS=0
end
/* Others sections ... */
/* Jump to BP Simulated data */
Ofs = Ofs + 24
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQLES */
/* Language Envt Stats */
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQISJ */
/* Start Join Stats */
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQ8ST */
/* Accelerator Services Stats */
/* */
/* OFFSET TO THE DATA SECTION MAPPED BY DSNDQBSP */
/* Simulated Buffer Pool Stats */
if BPSim = 'N' then return /* haha */