application tuning for ca datacom environments part ii
TRANSCRIPT
![Page 1: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/1.jpg)
World®’16
ApplicationTuningforCADatacomenvironments– PartIIKevinShuma,VPProductManagementCATechnologies
MFX67EB
MAINFRAMEANDWORKLOADAUTOMATION
![Page 2: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/2.jpg)
2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Abstract
ThisisatwopartsessionthatdescribesthevarioustechniquesusedtotuneaCADatacomapplicationforthebestpossibleperformance.Includedwillbediscussionsonavailablemonitoringtools.
ThissessionisprimarilyfocusedontheapplicationdeveloperwhoiswritingapplicationsfortheCADatacom®/DBdatabase.
KevinShuma
CATechnologiesVP,ProductManagement
![Page 3: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/3.jpg)
3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Agenda
APPLICATIONTUNINGWITHINTHEAPPLICATION
WHATISTHEURTANDHOWDOESITAFFECTTHEAPPLICATION
GENERALPROGRAMMINGRECOMMENDATIONS
IDEALPROGRAMMINGRECOMMENDATIONS
AVAILABLETUNINGTOOLSANDRESOURCES
SUMMARY
1
2
3
4
5
6
![Page 4: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/4.jpg)
4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ApplicationTuningwithintheapplication
§ Someapplicationissuesneedtoberesolvedwithintheapplication
§ Inothercases,newordifferentprogrammingtechniquescanbeusedtoimprovetheapplicationsperformance
§ Thissessionwilladdresswaystoimproveapplicationprocessingwithintheapplicationprogram
Bestpracticesthatcanbeapplied
![Page 5: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/5.jpg)
5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
WhatistheURTandhowdoesitaffecttheapplication
![Page 6: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/6.jpg)
6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
WhatisaURT?
§ Muchmorethanjustalistoftablesaccessedbytheprogram– Interfacecode(batchnon-Ideal)– Processingoptions– TableslistandSequentialReadAheadoptions– GBMAXR/GETBLK/SEQBUFS– GSETL/GETITinvokedautomaticallybyCAIdealFORconstructsunder
therightcircumstances– NotinvokedautomaticallyforCAMetaCOBOL+
Two-partwebcastisavailableonthesubjectofURTs
![Page 7: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/7.jpg)
7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SequentialReadAheadSimplifiedview
HalfofSEQBUFSbuffers(1-16)filledNOW
SecondhalfofSEQBUFSbuffers(17-32)filledwhilefirsthalfarebeingprocessed
ApplicationRegion MUFRegion
GSETL/GETIT SEQBUFS=32
GETBLK=61440GBMAXR=255
BlockofrowsreturnedsubjecttoGBMAXRlimit(255is“unlimited”)
![Page 8: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/8.jpg)
8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SequentialReadAhead(cont’d)
§ Pros– Significantlyfasterbatchsequentialprocessing– ReducedelapsedtimeduetoMUFread-ahead– ReducednumberofMUFtoapplicationcommunications
§ EspeciallyimportantwhenusingXCF– PossiblereducedIOsduetoveryfastbufferre-use
Simplifiedview
![Page 9: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/9.jpg)
9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SequentialReadAhead(cont’d)
§ Cons– Significantpossibilityforapplicationprogramtomisusethe
functionality§ Gettinglotsofdatarowsthatareneveractuallyreadintheprogram§ Typicalwhennotreadingthekeyrangefrombeginningtoend§ Fornon-Ideal,besuretospecifythekeyrangeendvalue
– Gettinglotsofdatarowsandholdingthemunderexclusivecontrol§ IfURThasUPDATE=YESallrowspassedinBlockGETxxbufferarelocked§ CanbeminimizedbyusingsmallerGBMAXRand/orGETBLK(e.g.GBMAXR=10)
Simplifiedview
![Page 10: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/10.jpg)
10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
URTPriority
§ MUFBREAKparameterwillinfluenceeffectiveness– BREAK500suitableatmostsites
§ WhattospecifyforPRTY=inURTs:– HotCICSAORsandHotTrustedServer:12– NormalCICSAORsandTrustedServer:10– Hotbatch(Time-sensitiveorCriticalPath):8or9– Normalbatch:7(CADefault)– DataqueryCICSAORsandAd-hocServer:5– Dataquerybatch,DBSQLPRandDataReporter:3
Doesitstillreallymatter?InabusyMUF,Yes!
![Page 11: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/11.jpg)
11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Generalprogrammingrecommendations
![Page 12: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/12.jpg)
12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
GeneralProgrammingRecommendations
§ Record-at-a-Time(RAAT)
§ Set-at-a-Time(SAATor“CBS”)
§ SQL
§ Canmixandmatchallthreeaccessmethodswithinasingleprogram
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 13: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/13.jpg)
13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Record-at-a-Time(RAAT)
§ MostcommonlyusedAPIforlegacyapplications– NotavailabledirectlytoprogrammersinCAIdeal– UsedbyCAMetaCOBOL+LOCATE/READstatements– SimilartoVSAMprogrammingAPI
§ Allprocessingselectionspredetermined(table,keys,elements)– Changestokeysorelementsrequireprogramchanges
§ Veryfastfordirectrandomkeyedaccess(LOCxx/REDxx)– Buteachrowisreturnedindividually– communicationsoverhead
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 14: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/14.jpg)
14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Record-at-a-Time(RAAT)(cont’d)
§ Sequentialreadahead(GSETx/GETxx)– Batchonly– Veryfastiftrawlingthroughlargekeyranges– TuneGBMAXR/GETBLK/SEQBUFSinURT– “New”feature(r12)tospecifyend-of-key-rangeonGSETL
§ Oftenrowsarereturnedthatarelaterrejectedbytheapplicationinnon-zIIPprocessing
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 15: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/15.jpg)
15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Set-at-a-Time(SAATor“CBS”)
§ APIbuiltforusewith4GLapplications– SimilartoSQLprogrammingAPI(withoutjoins)– CAIdealandCAMetaCOBOL+“FOR”constructs
§ CallDBNTRY….SELFR/SELNR/SELSM/SELPR
§ Dataviewscanonlyreferenceaverticalsubsetofasingletable
§ Canselectonnon-keycolumns,andorderrows– Reducingcommunicationsoverheadandperformingthe“sorting”onzIIP– ReviewoldprogramswithIFtestsandinternalsorts
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 16: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/16.jpg)
16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Set-at-a-Time(SAATor“CBS”)(cont’d)
§ CAMetaCOBOL+doesNOTconvertSRAcandidatestoGSETL/GETIT
§ CAMetaCOBOL+(orCALL)doesallowSKIPprocessingwithintheset– Changedirectionorjumptotop/bottomofset,orrelativeposition– Greatforsimple(single-table)scrollingapplications
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 17: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/17.jpg)
17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Set-at-a-Time(SAATor“CBS”)(cont’d)
§ TuneusingCBStrace– “$$$”inchars1-3ofUIB
§ Manualjoins(nestedFOR)oftenmeansrowsarereturnedthatarelaterrejectedbytheapplicationinnon-zIIPprocessing
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 18: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/18.jpg)
18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Set-at-a-Time(SAATor“CBS”)(cont’d)
§ Thetemporaryindex– CBSexaminestherequestmadeanddetermineshowtoaccessthedata– Atemporaryindexisbuiltif
§ Mixedascending/descendingORDERBY§ ORDER/GROUPBYanon-keyfield§ Signednon-positivenumericfieldspossibleinkey§ CBSchoseabetterkeytosatisfytheWHEREclause
– SometimesatemporaryindexisNOTabadthing.§ Unnecessaryonesshouldbeeliminated
OneDBMS,threeAPIsavailableto3GLs(COBOL,PL/I,etc.)
![Page 19: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/19.jpg)
19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CBS- BuildingatemporaryindexMixedORDERBYwithbothascendinganddescending
FOR FIRST PRICE-LIST-R001 WHERE EFCTV-DATE = W.EFCTV-DATE
AND FGI-ID = W.FGI-ID AND PRICE-CLS-ID = W.PRICE-CLS-ID AND ALWN-BRCKT-CDE GT $SPACES
ORDERED BY EFCTV-DATE FGI-ID PRICE-CLS-IDDESCENDING ALWN-BRCKT-CDE
FOR FIRST PRICE-LIST-R001 WHERE EFCTV-DATE = W.EFCTV-DATE
AND FGI-ID = W.FGI-ID AND PRICE-CLS-ID = W.PRICE-CLS-ID AND ALWN-BRCKT-CDE GT $SPACES
ORDERED BY DESCENDING EFCTV-DATE FGI-ID PRICE-CLS-IDALWN-BRCKT-CDE
Before After
Allthe“ascending”columnsintheORDERBYarespecifiedasequalitiesintheWHEREclause,sotheORDERBYcanbechangedwithoutimpactingtheprogram
![Page 20: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/20.jpg)
20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CBS- Buildingatemporaryindex(cont’d)
§ SQLCREATETABLEstatementsalwaysdefinenumericcolumnsassigned– DBAcanchangetounsignedafterwards
§ Ifthecolumnonlyevercontainspositivevalues– DBAshouldsetTYPE-NUMERIC=Pattribute
§ Ifthecolumndoescontainnegativevalues– DBAshouldsetDATA-SENSITIVEattribute
Signednumericcolumnsinkey
![Page 21: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/21.jpg)
21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CBS- DeterminingthebestkeytouseforCBS
§ CBSdynamicallychoosesthebestkeytousebasedoninformationinthewhereandorderbyclauses
§ Becarefulwhentryingtosecond-guessCBS– RunaCBStracetocheckthatyourassumptionwascorrect– Withtwosimilarcandidatekeys,StatisticalPopulationCountingcan
changethekeyselectionatruntime
§ Inthefollowingexample– TheORDERBYmatchesthenativekey– ButabetterkeymatchestheWHEREclause
![Page 22: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/22.jpg)
22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CBS- DeterminingthebestkeytouseforCBS(cont’d)Orderbydeterminesthekey– butisnotthebestchoice
FOR FIRST SALES-EST-PD WHERE MARKET-CODE EQ W.MARKET-CODE
AND SOURCE-CODE EQ $SPACES AND CURRENT-WEEK EQ W-WEEK AND CPCK-ITEM-CODE EQ $SPACES AND SETUP-WEEK-10 GE SETUP-DATE
ORDERED BY MARKET-CODE SOURCE-CODE
CURRENT-WEEK SETUP-WEEK-10
FOR FIRST SALES-EST-PD WHERE MARKET-CODE EQ W.MARKET-CODE
AND SOURCE-CODE EQ $SPACES AND CURRENT-WEEK EQ W-WEEK AND CPCK-ITEM-CODE EQ $SPACES AND SETUP-WEEK-10 GE SETUP-DATE
ORDERED BY MARKET-CODECURRENT-WEEK
SOURCE-CODE :MovedCPCK-ITEM-CODE :InsertedSETUP-WEEK-10
Before After
StatisticalPopulationCountingandaTemporaryIndex Nowadirectselection
![Page 23: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/23.jpg)
23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CBS- MoreWHEREclausetips
§ AvoidNOToperator,iffeasible– WHEREACTIVE=“Y”…ratherthan…– WHEREACTIVE<>“N”
§ Specifyanalternativeto“OR”-ingvaluesforafield- usearange,iffeasible– WHEREQTY=3OR4OR5…becomes…– WHEREQTY>=3ANDQTY<=5– ConverttoIFstatementONLYinspecialcircumstances
![Page 24: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/24.jpg)
24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SQL
§ Agile/DevOps- Quicktodevelop/maintain
§ Alljoins/aggregation/formattingdoneinMUF– AvailableforzIIPprocessing– Keepstheapplicationsmall/simple/efficient
§ Minimizescommunicationsoverhead– SQLpre-fetchworksforCICSrequeststoo
§ Ifthereissyntax/functionalityyouneed…– Submityourenhancement“Ideas”
Industrystandardsyntax
![Page 25: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/25.jpg)
25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SQL(cont’d)
§ SQLConstraintscanbeusedtoimplementbusinessrules– RunsinMUF(onzIIP)– Reducesneedforprogram“checks”
§ Don’tallowadeleteofacustomerthatstillhasanorder§ Onlyallowtype“A,B,C”§ UtilizeCASCADEtotriggerfulldeletes
§ SQLCACHEcanbeimplementedtoimproverepeateddynamicqueries
Industrystandardsyntax
![Page 26: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/26.jpg)
26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SQLtuningtips
§ INvs.OR– WHERECAT_TYPEIN(’05’,’07’)– WHERECAT_TYPE=’05’ORCAT_TYPE=’07’– UsuallyORisbetter
§ ORvs.BETWEEN– WHERECAT_TYPEIN(’05’,’06’,’07’)– WHERECAT_TYPE=’05’ORCAT_TYPE=’06’ORCAT_TYPE=’07’– WHERECAT_TYPEBETWEEN’05’AND‘07’– UsuallyBETWEENisbetter
Simplewhereclausepredicatetips
![Page 27: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/27.jpg)
27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SQLtuningtips(cont’d)
§ IndexcardinalitystatsandRowCounts– RETIXDBID=100,KEYNAME=*SETR– REPORTAREA=IXX,DBID=100,TYPE=G,UPDATE=YES– Don'tforgetUATenvironments– EspeciallyifrefreshedusingDASDutilities
§ SYSMSGenhancements– Mucheasiertounderstand– Predicatemessagesnolonger“lost”inPXX– SELECT*FROMSYSADM.SYSMSGWHEREPLANNAME='KEVIN';
SQLqueryoptimizationhousekeeping
![Page 28: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/28.jpg)
28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
COBOLtuningtips
§ COBOLSTRING/UNSTRINGwithpointerisveryefficient
§ Cachingusinginternalarrays– Goodorbad?– Directaccesscanbegood– SearchingisCPU-intensive
§ OrdertheEVALUATEpredicatesbymost-used->Least-used
SQLqueryoptimizationhousekeeping
![Page 29: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/29.jpg)
29 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
COBOLtuningtips(cont’d)
§ CBLOPTIMIZE– Dualcompile?
§ EnterpriseCOBOL5.xandbeyond- thebiggeststepchangesinceCOBOLII– Architectureexploitation(ARCH)– Choosethehighestlevelsupportedbyyourhardware– IncludingyourDRsite
SQLqueryoptimizationhousekeeping
![Page 30: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/30.jpg)
30 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogrammingrecommendations
![Page 31: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/31.jpg)
31 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $SUBSTR
§ $SUBSTRisoneofthemostCPU-intensivefunctionsofCAIdeal– Nevercodea$SUBSTRwithfixedvaluesforbothSTART=andLEN=– Breakthetargetfieldintoagroupfieldandreferencethedatadirectly
asasimplefield
§ Don’trepeatthesame$SUBSTRfunctionunnecessarily– SETtheresultintoasimplefieldandthenreferencethatfieldin
subsequentstatements
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 32: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/32.jpg)
32 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $SUBSTR(cont’d)Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
Level Field Name T I Ch/Dg ----- ------------------- - - -----1 SRA-DATA X 80
SELECT FIRST ACTION WHEN $SUBSTR(SRA-DATA,START=70,LENGTH=3) = 'ELM'
SET ELM = TRUE WHEN $SUBSTR(SRA-DATA,START=70,LENGTH=3) = 'DVW'
SET DVW = TRUE WHEN $SUBSTR(SRA-DATA,START=70,LENGTH=3) = 'PGM'
SET PGM = TRUE ENDSEL
Level Field Name T I Ch/Dg ----- ------------------- - - -----1 SRA-DATA 2 FILLER-1 X 692 SRA-ENT-TYP X 32 FILLER-2 X 8
SELECT FIRST ACTION WHEN SRA-ENT-TYP = 'ELM'
SET ELM = TRUE WHEN SRA-ENT-TYP = 'DVW'
SET DVW = TRUE WHEN SRA-ENT-TYP = 'PGM'
SET PGM = TRUE ENDSEL
Before After
![Page 33: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/33.jpg)
33 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $STRING
§ $STRINGisoneofthemostCPU-intensivefunctionsofCAIdeal– Dataiscopiedtoatemporaryworkarea,appendedandthencopiedto
thetargetarea– Whereappropriate,usethenewIdeal15.0DOCUMENTfeaturewith
variable-lengthfieldstoaccomplishthetask
§ Don’trepeatthesame$STRINGfunctionunnecessarily– Settheresultintoasimplefieldandthenreferencethatfieldin
subsequentstatements
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 34: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/34.jpg)
34 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $STRING(cont’d)Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
SET W.DUPLICATE = FALSE LOOP VARYING W.SUB2 FROM 1 BY 1 UNTIL W.DUPLICATE
OR W.SUB2 = 640 IF DUP-PGM-DVW(W.SUB2) =
$STRING(RPT.PROGRAM,RPT.STATUS,RPT.DATAVIEW)
SET W.DUPLICATE = TRUE ENDIF
ENDLOOP
Before
![Page 35: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/35.jpg)
35 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $STRING
§ Whileweareherewhatelsecanweimprove?– Avoidloopingthroughthewholearray
§ Inthiscase,all640entriesaresearchediftheincomingitemisNOTaduplicate
§ Storethe“maximumentry#”valuewhenthearrayisbuiltandusethatvaluetoterminatetheloop
– Avoidre-testingthe“terminator”valueoneachiterationoftheloop
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 36: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/36.jpg)
36 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $STRING(cont’d)Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
SET W.DUPLICATE = FALSE LOOP VARYING W.SUB2 FROM 1 BY 1 UNTIL W.DUPLICATE
OR W.SUB2 = 640 IF DUP-PGM-DVW(W.SUB2) =
$STRING(RPT.PROGRAM,RPT.STATUS,RPT.DATAVIEW)
SET W.DUPLICATE = TRUE ENDIF
ENDLOOP
BeforeSET W.DUPLICATE = FALSE SET NEW-PGM-DVW = $STRING(RPT.PROGRAM,
RPT.STATUS,RPT.DATAVIEW)<<SEARCH-PGM-DVW>>LOOP VARYING W.SUB2 FROM 1 BY 1 UP THRU W.DVW-MAX
IF DUP-PGM-DVW(W.SUB2) = NEW-PGM-DVW SET W.DUPLICATE = TRUE QUIT SEARCH-PGM-DVW
ENDIFENDLOOP
After
![Page 37: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/37.jpg)
37 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $STRING(cont’d)Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
SET W.DUPLICATE = FALSE LOOP VARYING W.SUB2 FROM 1 BY 1 UNTIL W.DUPLICATE
OR W.SUB2 = 640 IF DUP-PGM-DVW(W.SUB2) =
$STRING(RPT.PROGRAM,RPT.STATUS,RPT.DATAVIEW)
SET W.DUPLICATE = TRUE ENDIF
ENDLOOP
BeforeSET W.DUPLICATE = FALSE SET NEW-PGM-DVW = $STRING(RPT.PROGRAM,
RPT.STATUS,RPT.DATAVIEW)<<SEARCH-PGM-DVW>>LOOP VARYING W.SUB2 FROM 1 BY 1 UP THRU W.DVW-MAX
IF DUP-PGM-DVW(W.SUB2) = NEW-PGM-DVW SET W.DUPLICATE = TRUE QUIT SEARCH-PGM-DVW
ENDIFENDLOOP
After
SET NEW-PGM-DVW = $STRING(RPT.PROGRAM,RPT.STATUS,RPT.DATAVIEW)
LOOP VARYING W.SUB2 FROM 1 BY 1 UP THRU W.DVW-MAX
UNTIL DUP-PGM-DVW(W.SUB2) = NEW-PGM-DVWENDLOOP IF W.SUB2 > W.SUB
SET W.DUPLICATE = FALSE ELSE
SET W.DUPLICATE = TRUE ENDIF
After
IfyoureallyhateQUIT
![Page 38: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/38.jpg)
38 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas– Internalsorting
§ AVOIDunnecessaryinternalsorts– UseSQLtojoin/aggregate/sortdataintorequiredsequence
§ MoveworktoMUFwherezIIPCPUcanbeused– UsethesortedreportfacilityofCAIdealinstead,ifappropriate– Ifinternalsortistheonlyoption,avoidrepeatedlycalculatingtheindex
subscript§ Calculatethe“subscript– 1”onceandusethatinallsubsequentstatements§ Usegroupfieldtomovewholearray“row”atonce
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 39: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/39.jpg)
39 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Ifinternalsortistheonlyoption,avoidrepeatedlycalculatingtheindexsubscript
LOOP VARYING W.SUB FROM W.ENTRIES BY -1 DOWN THRU 1IF W.CURR-KEY < W.PREV-KEY
SET WT.PROD-CD = W.PROD-CD(W.SUB) SET WT.CUST-CD = W.CUST-CD(W.SUB) SET WT.EFCT-DT = W.EFCT-DT(W.SUB) SET WT.TERM-DT = W.TERM-DT(W.SUB) SET W.PROD-CD(W.SUB) = W.PROD-CD(W.SUB - 1) SET W.CUST-CD(W.SUB) = W.CUST-CD(W.SUB - 1) SET W.EFCT-DT(W.SUB) = W.EFCT-DT(W.SUB - 1) SET W.TERM-DT(W.SUB) = W.TERM-DT(W.SUB - 1) SET W.PROD-CD(W.SUB - 1) = WT.PROD-CD SET W.CUST-CD(W.SUB - 1) = WT.CUST-CDSET W.EFCT-DT(W.SUB - 1) = WT.EFCT-DTSET W.TERM-DT(W.SUB - 1) = WT.EFCT-DT
ENDIFENDLOOP
BeforeLOOP VARYING W.SUB
FROM W.ENTRIES BY -1 DOWN THRU 1IF W.CURR-KEY < W.PREV-KEY
SET W.SUB2 = W.SUB - 1 SET WT.ARRAY-ROW =
W.ARRAY-ROW(W.SUB) BY POSITIONSET W.ARRAY-ROW(W.SUB) =
W.ARRAY-ROW(W.SUB2) BY POSITIONSET W.ARRAY-ROW(W.SUB2) =
WT.ARRAY-ROW BY POSITIONENDIF
ENDLOOP
After
![Page 40: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/40.jpg)
40 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $TRIM
§ $TRIMisoneofthemostCPU-intensivefunctionsofCAIdeal– Whenbuildingoutputtextstrings
§ Avoidrepeatedlytrimmingtrailingblanksandsoonfromthesameinputstrings
– Ifrepeatedlyreferencingfixed-lengthinput§ Converttovariable-lengthworkingdatafieldwith$TRIMjustonceandreferencethat
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 41: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/41.jpg)
41 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Idealprogramminggotchas- $TRIM(cont’d)
§ Appendingdatatoanoutput“message”string– Defineoutputmessagestringasvariable-lengthworkingdatafield;no
needfor$TRIM– UsetheCAIdeal15.0DOCUMENTfeature
§ Particularlyrelevanttothesetypesofapplications– InterfacingwithIBMMQ-Series– Ideal/webinterfaceoutputdocuments
Idealisapowerfullanguagebutsomeprocessescanbeexpensivetouse
![Page 42: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/42.jpg)
42 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Re-InitializingArrays
§ Inbatch,storageischeap,CPUisexpensive– Ifanarrayhastobeclearedmanytimesduringexecutionofaprogram
§ Keepanemptycopyofthearrayinworkingdata§ UseSETreal-array=empty-arrayBYPOSITION
§ InCICS,storageisnotsocheap,sothismethodmaynotbeappropriateforlargearrays
![Page 43: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/43.jpg)
43 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CallingNon-IdealSubprograms
§ IfusinganyLanguageEnvironment(LE)-enabledlanguage– MakesureyouareusingtheCEEUOPTRTEREUS=ONoption
§ EnsuresthatLEruntimeenvironmentisonlyestablishedonce§ Workingdataandsoonispreservedbetweencallsofthesubprogram§ Significantperformanceimprovementswheresubprogramiscalledrepeatedly
![Page 44: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/44.jpg)
44 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
InsertorupdateexistingrowDeterminewhichtousebasedonlikelihoodthatrowalreadyexists
FOR FIRST dataviewnameWHERE...
update valuesWHEN NONE
FOR NEW dataviewnameinsert values
WHEN DUPLICATEhandle “unique” failures
ENDFORENDFOR
FOR NEW dataviewnameinsert values
WHEN DUPLICATEFOR FIRST dataviewnameWHERE...
update valuesENDFOR
ENDFOR
Rowisusuallypresent RowisusuallyNOTpresent
![Page 45: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/45.jpg)
45 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Dataviewsandelements
§ Dataviewsareacollectionofelements– Elementsaretheunitoftransfer
§ Definedasasinglefield– costsvsbenefits– nowonzIIP– Isolationfromothertablechanges– Agile/DevOps– SQLeffectivelydoesthis
§ Definedasthewholerow– Usewherethewholerowis/willbeALWAYSrequired
§ Definedasallthecolumnsinakey– Index-onlyprocessing.
ElementsareaDatacom-onlyconcept
![Page 46: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/46.jpg)
46 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
AvailableTuningtoolsandresources
![Page 47: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/47.jpg)
47 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Built-intuningtools
§ PXXJobstatistics– ShowsnumberofDatabaserequestsandI/O’s
§ RXXreports(andREADRXX)– Usefultotrackmaintenanceactivityandtimes
§ DatacomAccounting– Canbeverylowoverheadifdefinedcorrectly– Canbeextremelydetailedforusewhenrequired
§ DynamicSystemTables
IncludedwiththeDatacomenvironment
![Page 48: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/48.jpg)
48 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Built-intuningtools(cont’d)
§ AUTOINFO/AUTOSTATUS/AUTOCOLLECT– Usefulinspottingtrendsandcontentions
§ MUF– EOJSYSPRINT– JESLOG
§ CBSDiagnostictrace
§ SQLplanmessageoptions(ortraces)
IncludedwiththeDatacomenvironment
![Page 49: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/49.jpg)
49 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Built-intuningtools(cont’d)
§ CICSDEBUGFacility
§ CAIdealDEBUGfacility– Yesitrunsinbatch,andinruntime-onlyenvironments
§ IBMDebugTool– Basicbutcanbeveryuseful
IncludedwiththeDatacomenvironment
![Page 50: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/50.jpg)
50 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAApplicationTuningtools
§ CAIntertest– Functionallyrich– CodeCountingfeaturetoidentifyheavilyusedstatements
§ CASysview– Excellentforanalysisofcurrentactivity– CICSTransactionLogprovideshistoricalanalysis
§ MakesureSysview’sDCCTXPRhasbeenimplemented
AvailableforusewiththeDatacomenvironment
![Page 51: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/51.jpg)
51 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAApplicationTuningtools(cont’d)
§ CAMainframeApplicationTuner(MAT)– MajornewtoolforCAIdealandCOBOLandothers– Virtuallynooverheadandnorecompilesrequired
§ IrecommendyouattendthevarioussessionsontheseproductswhileyouareatCAWorld
§ ComeseeusattheDatacomdemostation
AvailableforusewiththeDatacomenvironment
![Page 52: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/52.jpg)
52 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Externalresources
§ CADREonCACommunitiescommunities.ca.com/community/ca-datacom-cadre– Thereisnosuchthingasa“stupidquestion”– Askquestionsandshareyourexperienceswithdevelopersacrossthe
globe– Submityour“Ideas”forproductenhancements– Specificenhancementrequestsarewelcome– Non-specific“Iwishsomehow..”requestsarejustaswelcome
AvailabletoCADatacomusers
![Page 53: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/53.jpg)
53 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Externalresources(cont’d)
§ CASupport– support.ca.com/irj/portal/anonymous/newhome– ThefriendlyCAsupportstaffhavedecadesofexperienceandare
alwayshappytohelp
AvailabletoCADatacomusers
![Page 54: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/54.jpg)
54 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
OurresultswhenapplyingapplicationtuningWehavemoreDatacomtablesthaneverbefore.Wehavemorerowsinthosetablesthaneverbefore.Wehavemoreapplicationsprocessingthedatathaneverbefore.Wehavefasterresponsetimes(batch,ServerandCICS)thaneverbefore.
Wehave30%lessCPU(MSUs)thanatthestartofthetuningexercise.ThemainframeisnolongerthehighestTCOserver.
SummaryCommentsfromthemanagingDBAforthetwositesprofiledinPartI
![Page 55: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/55.jpg)
@CAWORLD#CAWORLD ©2016CA.AllRIGHTSRESERVED.55 @CAWORLD#CAWORLD ©2016CA.AllRIGHTSRESERVED.55
MainframeandWorkloadAutomation
FormoreinformationonMainframeandWorkloadAutomation,pleasevisit:http://cainc.to/9GQ2JI
![Page 56: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/56.jpg)
56 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
RecommendedSessionsSESSION# TITLE DATE/TIME
MFX92S StrategyandVisionforCADatacomandCAIdeal 11/16/2016at12:45pm
MFX93S What’snewinCADatacom 11/16/2016at1:45pm
MFX94S ReducingTCOwithDatacomCompression(Presspack) 11/16/2016at3:00pm
MFX95SA ModernizingtheCADatacomdata – SQLAccessPartI 11/16/2016at3:45pm
MFX95SB ModernizingtheCADatacomdata – SQLAccessPartII 11/16/2016at4:30pm
MFX96S CADatacom/ADInstallation/UpgradeandMaintenance 11/17/2016at12:45pm
MFX97S CADatacom/ADReportUtilization,andinformationgatherforSupport 11/17/2016at1:45pm
MFX98SUsingSysview tomonitorandmeasureyourCADatacomenvironment– ADandDB
11/17/2016at3:00pm
MFX99S BirdsofaFeather/StumptheTechie! 11/17/2016at3:45pm
![Page 57: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/57.jpg)
57 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Questions?
![Page 58: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/58.jpg)
58 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Thankyou.
Stayconnectedatcommunities.ca.com
![Page 59: Application Tuning for CA Datacom Environments Part II](https://reader033.vdocuments.us/reader033/viewer/2022042706/58739f921a28ab85438b741d/html5/thumbnails/59.jpg)
59 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.
Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.
ForInformationalPurposesOnlyTermsofthisPresentation