360 likes | 1.17k Views
Advantage TM CA-IDMS ® User Exits and Database Procedures. Data Management and Application Development DI440SN. Session Abstract .
E N D
AdvantageTM CA-IDMS® User Exits and Database Procedures Data Management and Application Development DI440SN
Session Abstract • This session discusses the various exits available within AdvantageTM CA-IDMS® and how they can be used to monitor, modify and enhance the functionality available within AdvantageTM CA-IDMS®. Real life examples will be given. Internal conventions are also discussed.
Biography • Pete Charles COGITO • I have been working with AdvantageTMCA-IDMS® for more than 25 years. Six of these were with Cullinet. In this time I have given many classes and presentations at many Cullinet , Computer Associates and IUA conferences. I work for COGITO but spend the vast majority of my time at BT.
Agenda • AdvantageTM CA-IDMS® ’systems programming’ • DB Exits • DC/UCF Exits • Numbered Exits • Database Procedures • Miscellaneous Exits • Internal conventions
CA-IDMS® ’systems programming’ • Code is an extension of the AdvantageTM CA-IDMS® systems • Can have high profile on failure • Extend or modify system functions • Add system functions • Monitor system functions • Global application functionality • Written in Assembler
DB Exits IDMSCLCX • CALC Exit • Linked with IDMSDBMS and IDMSUTIL • Write your own CALC routine!! • Called when ever the system is calculating a CALC target page • Failure means all CALC activities fail. So system would be unusable • Can be used for tailored segmentation of large database • Only global record exit
DB Exits IDMSAJNX • Archive Journal exit • Linked with IDMSUAJN • Called after each journal block is offloaded • Can be used to analyses journal records • Statistics collection, Audit trails, Security Checks • Failure not too catastrophic
DB Exits IDMSDBIO • Four different exits available for IDMSDBIO • IDMSDPLX , IDMSIOXT , IDMSIOX2 and IDMSJN2 • All must be linked with IDMSDBIO • All I/O related • Duplicate I/O e.g. provide a duplex journal • Substitute I/O e.g. COGITO’s DB-Image, ASG’s Fast Access
DB Exits IDMSDBIO • I/O Error handling • IDMSIOX2 is most comprehensive • Lots of hooks for third party software • Impact of failure depends on scope • Might only affect a single file but could affect whole CV
DC/UCF Exits TCKREXIT • Ticker Exit • Called at every ticker interval as defined in the SYSGEN • Linked with CV startup module • Can be used to control or monitor time related events • Impact of failure. If it abends you will get SMPC every ticker interval
DC/UCF Exits WAITEXIT • Called at every time CV issues an operating system wait • Linked with CV startup module • Can be used to monitor ‘idle’ time
DC/UCF Exits WTO Exits • WTOEXIT called when ever IDMS writes to the console • Most commonly used to submit Archive Journal and Log Offload jobs • Also to submit start up, shutdown or user jobs • WTOREXIT called when ever IDMS solicits an operate reply • Both linked with CV startup module
Numbered Exits • Can be linked as DC program or with RHDCUXIT • Identified by number • Can use either IBM or DC calling conventions • May be user or system mode.Some system exits must be system mode • I would ALWAYS us DC Calling conventions and system mode • Abends cause system dumps
Numbered Exits • 0 through 255 are system exits. Currently go up to 38 • System exits defined by CA • 256 and above are user exits • Users exits called by using #XIT macro. • All defined by #DEFXIT macro
Numbered Exits RHDCUXIT CSECT #DEFXIT , EXIT 00 #DEFXIT MODE=SYSTEM,CALL=DC,EP=XSON,AMODE=ANY EXIT 01 #DEFXIT , EXIT 02 #DEFXIT , EXIT 03 #DEFXIT , EXIT 04 #DEFXIT MODE=SYSTEM,CALL=DC,EP=XTASK,AMODE=ANY EXIT 05 MODE=SYSTEM or USER, CALL=DC or IBM
Common Numbered Exits • 00 System Startup • 14 BIND RUN UNIT and READY AREA • 23 PRE BIND RUN UNIT ( Called before Exit 14 ) • 20 Resource Limit • 30 Dead Lock victim selection
Database Procedures • Schema Defined • Area or Record level • Linked stand alone • Called By IDMSDBMS so an extension of the database manager • Defined in SYSGEN • Write in Assembler
Schema Record Syntax CALL procedure-name --- BEFore -------------------------------+ +- AFTer -----------¦ +- CONnect ----¦ +- on ERRor during -+ +- DISCONnect -¦ +- ERAse ------¦ +- FINd -------¦ +- GET --------¦ +- MODify -----¦ +- STOre ------+
Schema Area Syntax CALL procedure-name --- BEFore ------------------------------------+ +- AFTer -----------¦ +- function-option -+ +- on ERRor during -+ Expansion of function-option >>--- REAdy ------------------------------------------------------------------>< +- for --- EXCLUSive --- UPDate --------+ +- RETrieval -+ +- PROtected --- UPDate ------ +- RETrieval -+ +- SHAred --- UPDate --------- +- RETrieval -+ +- UPDate -------------------- +- RETrieval -----------------+ - FINish ------------------------------------------¦ +- COMmit ------------------------------------------¦ +- ROLlback ----------------------------------------+
Compression/Decompression • CA Provide IDMSCOMP and IDMSDCOM for compression and decompresssion • Call IDMSDCOM after GET • CALL IDMSCOMP before STORE and before MODIFY • CA recommend that both are called before FINISH. Causes them to free their storage
DB Procedures and Security • Encrypt sensitive data • Cancel the DML Command • Can use the #SECHECK Macro
DB Procedures and Restructure • Use to populate new fields using application logic • Use NUPROCS parameter for restructure • Procedure called before MODIFY i.e. after record has been restructured but before it is written back to database • Very fast. Much quicker than adding field then an application to populate.
Miscellaneous Exits • OPTIXIT and OPTIQXIT are used in the CICS environment • Linked with IDMSINTC • Used to dynamically route transaction to different CVs • OPTIXIT is for DML and OPRQXIT is for SQL
Miscellaneous Exits • IDMSSVCX SVC exit • DC exits are an extension of CA-IDMS • IDMSSVCX is an extension of the operating system • It runs in key 0 supervisor state so can over write ANY location in memory • Errors in this can bring down the operating system. Yes I have seen it happen • Used to add data into ERE must commonly for accounting/charging
Internal Conventions • R9 always point to the TCE for the active task • R10 always points to the IDMSCSA • R13 always points to next available word in the TCE stack • R12 Normally base register • R14 Return address • R11 very often to used to point to work area
Internal Conventions • #MOPT Macro used to set mode to system or user ( always use system ) • #START Macro. Most import for multitasking as it defines the MP mode required by the exit • Getting MP mode wrong can have many side effects • An example is a DB procedure that was not changed to rum mode any at R1 • Caused hundreds of thousands of waits for mode DB
Internal Conventions • #RTN Macro just returns • #GETSTK used get a small amount of work space from TCE stack • By default address returned in R11 • If issuing any DC calls always use RGSV option on the macro being used • Can specify R2 to R8 • R9 and R10 are fixed and should never be changed
Internal Conventions • R11,R12, R13 and R14 are always saved • R0,R1 and R15 are overwritten by the macro so are never saved
Summary A Few Words to Review • Simple but powerful tools • CV administration • CV extensions • DBA tools • Application Components • Easier then they sound • Remember they are there and check if they can help you
Session Evaluation Form After completing your session evaluation form ... ... please place it in the basket at the back of the room.