IMS Transaction Manager

Embed Size (px)

DESCRIPTION

cobol programs

Citation preview

  • AgendaIMS OverviewIMS TM ArchitectureMessage Format ServicesCOBOL Programming for IMS DCConversational Programming

    IMS Transaction Manager

    3/30/2009 9:00 AM *

    IMS Overview

  • Product FeaturesA mature product from IBMOver 40 years in the marketMost critical corporate data under IMSTwo separate strategic productsIMS DB ManagerIMS Transaction ManagerIMS Overview

  • IMS ComponentsPrimary Products IMS/DB - Database management, logging & recoveryIMS/TM - Interactive online functions, transaction driven

    Product ImplementationsDBCTLDCCTLDB/DC

    IMS Overview

  • IMS Dependent RegionsDL/I Region

    MPP Regions

    BMP RegionsIMS Overview

  • IMS Batch EnvironmentExecution via JCL.Each job in an address space.Programs address space contains a copy of DL/I modules.Programs added without having to modify the IMS system definition.IMS Overview

  • IMS On-line EnvironmentHigh volume, rapid response transaction processing.DBCTL or DCCTL.IMS is a started task of MVS.IMS system definition must include information about all programs and resources under the control of IMS.IMS Overview

  • IMS On-line EnvironmentIMS handles information in the form of messages that flow between terminals and application programs.

    DL/I modules reside either in the control region or in a separate address space called DLISAS.

    Hence DL/I services are centralized and can be shared by all dependent regions.IMS Overview

  • Functions of TMProvides users with online access to applicationsProcesses high volume of online transactionsProvides rapid response time for application programsDefines a logical and physical terminal structureSupports database management integration

    IMS Overview

  • IMS TMTerminalTerminalCommunication ModulesApplication ProgramQueue ManagementModulesDL/I ModulesDatabasesQPOOLMessage Overflow DatasetDB CallsDC Calls Message QueuesIMS Overview

  • Message Processing Regions (MPRs)Process on-line transactions from terminals.

    Application programs are automatically scheduled by IMS as a result of data coming into the system from terminals. IMS Overview

  • Batch Message Processing (BMP) RegionsRegion starts when job submitted by operator.

    BMP programs access IMS message queues and on-line databases.IMS Overview

  • /DIS AIMS EnvironmentsIMS Overview

  • SDSF SpoolIMS EnvironmentsIMS Overview

    3/30/2009 9:00 AM *

    IMS TM Architecture

  • IMS TM ArchitectureAddress SpacesIMSGENTerminalsMaster Terminal Operator (MTO)Message TypesMessage QueuingIMS Security

    IMS TM Architecture

  • Address SpacesIMS TM Architecture

  • IMSGENUsed to build the IMS resourcesUses series of user customized macrosMacros can beSystem MacrosApplication MacrosTerminal Network Macros

    IMS TM Architecture

  • System MacrosIMSCTRL Defines IMS System ParametersIMSCTF Defines IMS and DBCTL ParametersMSGQUEUE Defines the Message QueuesBUFPOOLS Defines the control block buffer pools

    IMS TM ArchitectureIMSGEN

  • Application MacrosDATABSE Defines DatabasesAPPLCTN Defines Application Programs TRANSACT Defines transactions and its parameters

    IMS TM ArchitectureIMSGEN

  • Terminal Network MacrosCOMM Defines Communication DefaultsTERMINAL Defines Physical Terminals NAME Defines Logical Terminals

    IMS TM ArchitectureIMSGEN

  • Terminal DefinitionTerminal DefinitionPTERMLTERM

    Logical Terminal TypesStatic TerminalDynamic TerminalIMS TM Architecture

  • Static TerminalPredefined in IMSGEN

    IMS TM Architecture

  • Dynamic TerminalPrompts the user to sign onLTERM is created dynamicallyUses installation rules to create LETRMHelps to reduce the size of IMSGEN

    IMS TM Architecture

  • Master Terminal OperatorManages the over all TM environmentSupports commands to modify the status and characteristics of TM componentsIMS TM Architecture

  • Master Terminal OperatorManages and controlsUser-Terminal Network

    Message SchedulingEnvironment System Control ActivitiesIMS TM Architecture

  • Message TypesTransactionsMessage SwitchesCommandsIMS TM Architecture

  • TransactionsIMS TM Architecture

  • TransactionsTransaction Consists ofTransaction CodePasswordA blank SpaceMessage TextIMS TM Architecture

  • Message SwitchesManages MessagesAllows terminals to communicate with each otherIMS TM Architecture

  • Message SwitchesMessage Switch consists ofLTERM NamePasswordA blank spaceMessage Text

    IMS TM Architecture

  • CommandsControls IMS OperationsOriginated from user terminal or application programIMS TM Architecture

  • CommandsA Command consists ofA forward slash (/)Command verbPasswordA blank spaceCommand KeywordIMS TM Architecture

  • CommandsIMS TM Architecture

  • Message QueuingMessage Queues are used toRoute I/P message to Application ProgramsRoute O/P message to TerminalIMS TM Architecture

  • Message QueuingIMS TM Architecture

  • Message QueuingFunctions of Message QueuesProcessing transactionsStoring and prioritizing messagesMaintaining message queue buffersProcessing multiple message queues

    IMS TM Architecture

  • Message QueuingIMS TM Architecture

  • IMS SecuritySecurity Maintenance Utility (SMU)Resource Access Control Facility (RACF)IMS TM Architecture

  • SMUA Security feature specific to IMSDefines control statements to protect IMS resourcesIMS TM Architecture

  • RACFAn independent facilityAuthentication using passwordsIMS TM Architecture

  • APPLCTN MacroDefines Program Resource RequirementsOne APPLCTN macro is combined with one or more TRANSACT macros

    SyntaxAPPLCTN FPATH=_ _ _, LANG=_ _ _, PSB=_ _ _, PGMTYPE=_ _ _, SCHDTYP=_ _ _

    ValuesFPATH --- yes/noLANG--- Language TypePSB--- PSB to be usedPGMTYP--- TP / BatchSCHDTYP--- Parallel / SerialIMS TM Architecture

  • TRANSACT MacroSpecifies the transaction codes that cause the application program named in the preceding APPLCTN macro Defines various transaction parameters

    SyntaxTRANSACT CODE=,FPATH=, Inquiry=,MSGTYP=, PRTY=(,,), SERIAL=

  • M F SAn IMS/TM facilityDefines a screen and its variables Formats messages transmitted to and from display screens.Message Format Service

  • Message Flow using MFSMessage Format Service

  • Functions of MFSSimplifies message handlingMakes applications device independentProvides full paging capabilityFormats messages using Control BlocksMessage Format Service

  • Simplifies message handling

    Message Format Service

  • Makes applications device independentMessage Format Service

  • Provides full paging capability

    Message Format Service

  • Formats messages using Control Blocks

    Message Format Service

  • MFS Control BlocksMessage Input Descriptor MIDMessage Output DescriptorMODDevice Input FormatDIFDevice Output FormatDOFMessage Format Service

  • Information FlowMessage Format Service

  • MFS Control StatementsDevice Format Control StatementsMessage Descriptor Control StatementsCompilation Control StatementsMessage Format Service

  • MFS Control StatementsMessage Format Service1 8Label10 14Operation16 71Operand / Comment72ContinuationCharacter

  • Device Format StatementsFMT DEV DIV DPAGE DFLD .. DFLD DPAGE DFLD .. DFLD DEV DIV DPAGE DFLD .. DFLDFMTENDMessage Format Service

  • DEV StatementDEVTYPE=(3270,1) ,FEAT=IGNORE [,PFK=(pfkeyfeild, [integer=] literal] NEXTPP NEXTMSGP NEXTLP ENDMPPI [,DSCA=Xnnnn][,SYSMSG=msgfield]

    Message Format Service

  • PFK=(PFKTEXT,1=01,2=02, 3=03,10=10)

    PFK=(PFKTEXT,01,02, 03,,,,,,,10)

    PFK=(PFKTEXT,1=01,2=02, 3=03,4=NEXTPP,5=NEXTLP,10=10)

    Message Format ServicePFK KeywordDEV Statement

  • DIVTYPE=INOUT

    Message Format ServiceDIV Statement

  • labelDPAGECURSOR=(line,column)/fieldname,FILL=fillcharMULT=YES

    Message Format ServiceDPAGE Statement

  • labelDFLDliteral,POS=(line,column), LTH=length of field,ATTR=(attribute1,attribute2, attribute3,attribute4),EATTR=(e-attribute1,e-attribute2)

    Message Format ServiceDFLD Statement

  • Attribute1ALPHA / NUMAttribute2PROT / NOPROTAttribute3NORM / NODISP / HIAttribute4NOMOD / MODMessage Format ServiceDFLD StatementATTR keyword

  • EAttribute1 HD / BLINK / HREV / HULEAttribute2 CD / BLUE / RED / PINK / GREEN / TURQ / YELLOW/ NEUTRALMessage Format ServiceDFLD StatementEATTR keyword

  • DFLD Statement - Examples DFLD PURCHASE ORDER INFORMATION SYSTEM,X POS=(1,7),X LTH=33,X ATTR=(ALPHA,PROT,HI),X EATTR=(HUL,BLUE)

    ORDERNO DFLD POS=(3,5),X LTH=10,X ATTR=(NUM,NOPROT,HI,MOD),X EATTR=(HD,YELLOW)Message Format Service

  • EQU StatementsAPH EQU ATTR=(PROT,HI)

    TOTAL1DFLDPOS=(3,10),LTH=8,APHMessage Format Service

  • DO StatementsMessage Format ServiceDO Statement is used for looping the repeated field patterns

    DO12PDATE DFLD POS=(6,2),LTH=8,ATTR=(PROT,ALPHA,NORM,NOMOD)PBNKNO DFLD POS=(6,12),LTH=25,ATTR=(PROT,ALPHA,NORM,NOMOD)PCHKNO DFLD POS=(6,38),LTH=16,ATTR=(PROT,ALPHA,NORM,NOMOD)PAMT DFLD POS=(6,55),LTH=9,ATTR=(PROT,ALPHA,NORM,NOMOD) ENDDO

  • Device Format Statements - ExerciseMessage Format Service

  • Device Format Statements - ExerciseMessage Format ServiceP030MD FMT DEV TYPE=(3270,2),FEAT=IGNORE,SYSMSG=SYSMSG,PFK=(PFKEY,01='M28H900T HELP ,05=P0300M0T CONT ,11= 'P0300M0T MENU ') DIV TYPE=INOUT DPAGE CURSOR=((03,08,CURPOS)),FILL=PT*

  • Device Format Statements - ExerciseMessage Format ServiceDFLD 'PHF - P0300M0T',POS=(01,02),ATTR=PROT DFLD 'PO REQUISITION ',POS=(01,36), ATTR=PROT DFLD 'RETURNED REQUISITIONS',POS=(02,33), ATTR=PROT DFLD 'LOC (',POS=(03,02), ATTR=PROT DFLD ')',POS=(03,13), ATTR=PROT DFLD 'PLANT (',POS=(03,16), ATTR=PROT DFLD ')',POS=(03,27), ATTR=PROT DFLD 'OR REQ # (',POS=(03,30), ATTR=PROT DFLD ')',POS=(03,54), ATTR=PROT DFLD 'OPT REQUISITION DATE ISSUED BY',POS=(05,03), ATTR=PROT DFLD 'DATE BUYER',POS=(05,51), ATTR=PROT DFLD 'NUMBER ISSUED',POS=(06,09), ATTR=PROT DFLD 'REQUIRED',POS=(06,49), ATTR=PROT

  • Device Format Statements - ExerciseMessage Format ServiceDO12 DFLD '(',POS=(07,02),ATTR=PROT DFLD ')',POS=(07,06),ATTR=PROTENDDO DFLD 'OPTIONS: X=ALL B=BASIC C=COMMENTS I=ITEM', POS=(21,02),ATTR=PROT,HI DFLD 'D=DELIVERY H=CHARGE', POS=(21,53),ATTR=PROT,HI DFLD 'R=RETURN TO BUYER M=SUPPLIER', POS=(22,11),ATTR=PROT,HI DFLD 'T=DECODER V=CODE CATLG',POS=(22,44),ATTR=PROT,HI DFLD 'PF1=HELP PF5=CONT PF11=MENU ', POS=(23,20),ATTR=PROT

  • Device Format Statements - ExerciseMessage Format ServiceSYSMSG DFLD POS=(24,01),LTH=77,ATTR=HIDATE2 DFLD POS=(01,55),LTH=08,ATTR=PROTTIME DFLD POS=(01,64),LTH=05,ATTR=PROTLTNAME DFLD POS=(01,73),LTH=08,ATTR=PROTLOCORIG DFLD POS=(03,08),LTH=04,ATTR=MODPLANTCD DFLD POS=(03,24),LTH=02,ATTR=MODREQNUM DFLD POS=(03,42),LTH=11,ATTR=MOD DO 12OPT DFLD POS=(08,04),LTH=01,ATTR=MODREQNUM DFLD POS=(08,08),LTH=11,ATTR=PROT,MODISDDAT DFLD POS=(08,21),LTH=08,ATTR=PROTISDNAM DFLD POS=(08,31),LTH=15,ATTR=PROTDATREQ DFLD POS=(08,49),LTH=08,ATTR=PROTBUYER DFLD POS=(08,59),LTH=20,ATTR=PROT ENDDO FMTEND

  • Message Descriptor StatementsMSG LPAGE SEGMFLD..MFLD SEGMFLD..MFLD LPAGE SEGMFLD..MFLDMSGENDMessage Format Service

  • MSG StatementMsgname MSGTYPE=INPUT/OUTPUT,XSOR=(dpagename,IGNORE),XNXT=next message name,XPAGE=YESMessage Format Service

  • LPAGE StatementMOD set counter part of DPAGEUsed for Paging of ScreensCan have multiple LPAGEs subordinate to a MSG statementMessage Format Service

  • MFLD StatementMFLDliteral/DFLD name,XLTH=length,XMessage Format Service

  • MFLD Statement - Examples MFLDHi Program,XLTH=10

    MFLDORDERNO,XLTH=10

    MFLD(ORDERNO,1111111111), XLTH=10Message Format Service

  • Message Format Statements - ExerciseMessage Format Service

  • Message Descriptor Statements - ExerciseMessage Format ServiceMID

    PMHF MSG TYPE=INPUT,X SOR=(P030MD,IGNORE),X NXT=PHF SEG MFLD (PFKEY,'P0300M0T @ '),LTH=14 MFLD LOCORIG,LTH=04 MFLD PLANTCD,LTH=02 MFLD REQNUM,LTH=11 MFLD CURPOS,LTH=04DOLBLI DO 12 MFLD OPT,LTH=01 MFLD REQNUM,LTH=11 MFLD (ISDDAT,'@'),LTH=08 MFLD (ISDNAM,'@'),LTH=15 MFLD (DATREQ,'@'),LTH=08 MFLD (BUYER,'@'),LTH=20ENDOLBLI ENDDO MSGEND

  • Message Descriptor Statements - ExerciseMessage Format ServiceMOD

    PHF MSG TYPE=OUTPUT,X SOR=(P030MD,IGNORE),X NXT=PMHF SEG MFLD (DATE2,DATE2) MFLD (TIME,TIME) MFLD (LTNAME,LTNAME) MFLD SYSMSG,LTH=77 MFLD CURPOS,LTH=04 DOLBLM DO 12 MFLD OPT,LTH=01 MFLD REQNUM,LTH=11 MFLD ISDDAT,LTH=08 MFLD ISDNAM,LTH=15 MFLD DATREQ,LTH=08 MFLD BUYER,LTH=20ENDOLBLM ENDDO MSGEND END

    3/30/2009 9:00 AM *

    IMS DC Application Programming

  • IMS Transaction FlowSequence of Events :Message InputMessage RetrievalMessage ProcessingMessage OutputIMS DC Application Programming

  • Message InputOriginates at a terminal.

    Stored in the appropriate message queue.

    A group of message segments making up a message is transmitted at one time.IMS DC Application Programming

  • IMS Transaction FlowIMS DC Application Programming

  • Message SelectionIMS TM selects messages from the message queue.

    IMS then schedules the associated MPP for loading into an available MPP processing region.IMS DC Application Programming

  • Message ProcessingMPP retrieves message segments one at a time, using GU and GN calls.LENGTHZZFieldMESSAGE TEXTTrans Name (2) (2) (8)IMS DC Application Programming

  • Message OutputMPP issues ISRT calls to send messages back to the originating terminal.

    These output messages are stored in the message queue sequenced by the destination name.IMS DC Application Programming

  • DL/I CallsFor retrieving messages :

    GUGNIMS DC Application Programming

  • DL/I Calls01 INPUT-MESSAGE-AREA. 05 INPUT-LL-FILEDPICS9(4) COMP. 05 INPUT-ZZ-FILEDPICS9(4) COMP. 05 INPUT-TRAN-CODEPIC X(8). 05 INPUT-MESSAGE-DATA 10 INPUT-PART-NO PIC X(10). 10 INPUT-ASSEMBLY-NO PIC X(12). 10 INPUT-PART-NAME PIC X(20). 10 FILLER PIC X(100).

    IMS DC Application Programming

  • DL/I CallsIMS DC Application ProgrammingCALL CBLTDLIUSING GU IO-PCB-MASKINPUT-MESSAGE-AREA.

    IF IO-PCB-STATUS-CODE = QC MOVE Y TO WS-NO-MORE-MESSAGEELSE CONTINUE (PROCESS THE MESSAGE)

  • DL/I CallsIMS DC Application ProgrammingCALL CBLTDLIUSING GN IO-PCB-MASKINPUT-MESSAGE-AREA.

    IF IO-PCB-STATUS-CODE = QD MOVE Y TO WS-NO-MORE-MESSAGEELSE CONTINUE. (PROCESS THE MESSAGE)

  • I-O PCB MaskIO-PCB-LOGICAL-TERMINALPIC X(8).FILLERPIC XX.IO-PCB-STATUS-CODEPIC XX.IO-PCB-DATEPIC S9(7)COMP-3.IO-PCB-TIMEPIC S9(6)V9 COMP-3.IO-PCB-MSG-SEQ-NUMBERPIC S9(5)COMP.IO-PCB-MOD-NAMEPIC X(8).IO-PCB-USERIDPIC X(8). IMS DC Application Programming

  • DL/I Calls - contd.For sending messages :

    ISRTCHNGPURGEIMS DC Application Programming

  • DL/I Calls - contd.01 OUTPUT-MESSAGE-AREA. 05 OUTPUT-LL-FILED PIC S9(4) COMP. 05 OUTPUT-ZZ-FILED PIC S9(4) COMP. 05 OUTPUT-PART-NO PIC X(10). 05 OUTPUT-ASSEMBLY-NO PIC X(12). 05 OUTPUT-PART-NAME PIC X(20). 05 OUTPUT-VENDOT-CODE PIC X(05). 05 OUTPUT-STAMPETR-CODE PIC X(08).

    01 WS-MOD-NAME PIC X(08) VALUE PARTSCRN .IMS DC Application Programming

  • DL/I Calls - contd.MOVE LENGTH OF OUTPUT-MESSAGE-AREA TO OUTPUT-LL-FIELD

    CALL CBLTDLIUSING ISRT IO-PCB-MASKOUTPUT-MESSAGE-AREAWS-MOD-NAME.

    IMS DC Application Programming

  • Program Communication BlockCalls for retrieving input messages and inserting output messages must reference an IOPCB.

    IO-PCB : first PCB listed on the ENTRY statement.

    Messages can be routed to other destinations using ALT-PCB.IMS DC Application Programming

  • Alternate PCBs

    To send messages to several alternate destinations, all via the same ALT-PCB.IMS DC Application ProgrammingPCB TYPE=TP,LTERM=M3270,ALTRESP=YES,EXPRESS=YES

    PCB TYPE=TP,MODIFY=YES,EXPRESS=YESPSB

  • ALT-PCB Masks01 ALT-PCB-MASK. 05 ALT-PCB-DESTINATIONPICX(8). 05 FILLERPICXX. 05 ALT-PCB-STATUS-CODEPICXX. IMS DC Application Programming

  • Routing O/P to Alternate DestinationCALL CBLTDLI USING CHNG ALT-PCB-MASK WS-DESTINATION-NAME.

    CALL CBLTDLI USING ISRT ALT-PCB-MASK MESSAGE-IO-AREA.

    CALL CBLTDLI USING PURG ALT-PCB-MASK.

    IMS DC Application Programming

  • Multiple Alternate DestinationsMOVE new-dest-nameCHNGISRTPURG

    MOVE new-dest-nameCHNGISRTPURG

    ---------------------------IMS DC Application Programming

  • Dynamic Controlling Field AttributesDefine the fields in DIF/DOF with a label

    Include the field label in MID/MOD with operand ATTR=YES

    Length of the MFLD should be equal to length of DFLD + 2

    Code the program to pass correct control information to MFSMessage Format Service

  • Identifying FieldsATTR = YES in MFLD statement.

    First two bytes contain control information.

    User data starts in third byte.Message Format Service

  • First ByteFor controlling field oriented cursor positioning.X00 no cursor positioning required on this field.XC0 cursor should be positioned on this field.Message Format Service

  • Second ByteFor controlling attributes.Message Format Service

  • Attribute Handling in ProgramsA two byte prefix should be included for each of the fields having ATTR=YES in MFS.

    Appropriate control bit combinations should be moved to the second byte of the prefix.Message Format Service

  • Dynamic Attribute Handling - ExampleDIF/DOFCUSTIDDFLDPOS=(5,15),ATTR=HI,LTH=10

    MOD MFLDCUSTID,ATTR=YES,LTH=12

    MID MFLDCUSTID,ATTR=YES,LTH=12

    Message Format Service

  • Dynamic Attribute Handling - Example

    PROGRAMWS01 INPUT-OUTPUT-AREA. - - - - - - - - - - - - - - - - - - 05 CUSTOMER-ID-INFO. 10 CUSTOMER-ID-ATTRPIC X(02).10 CUSTOMER-ID-DATAPIC X(10). - - - - - - - - - - - - - - - - - -

    PDMOVE valueTO CUSTOMER-ID-ATTR.

    Message Format Service

  • Cursor ControlDefault Cursor PositioningDynamic Cursor PositioningField Oriented Cursor ControlAbsolute Cursor ControlMessage Format Service

  • Default Cursor PositioningBy coding CURSOR Parameter on DPAGE statementDPAGE CURSOR=((3,17))Message Format Service

  • Field Oriented Cursor ControlShould haveATTR=YESCode the program to pass correct control information to MFS.Message Format Service

    3/30/2009 9:00 AM *

    Conversational Programming

  • Program-to-Program Message SwitchImmediate Message Switch Program that receives the input message is not the same one that responds to the terminal.

    Deferred Message SwitchA single conversation involves more than one application program, one for each terminal interaction.

    Conversational Programming

  • Immediate Message SwitchProgram 1Program 2TerminalInputOutputSPAMessageConversational Programming

  • Deferred Message SwitchConversational Programming

  • Conversational TransactionsThere are three different ways to store data

    On the Terminal ScreenIn a DatabaseIn SPA

    The ending of a conversation should be handled by the program.Conversational Programming

  • Storing Data on ScreensStore data in Protected, Hidden fields with MDTs ON.

    For small amounts of non-critical data only.Conversational Programming

  • Storing Data in a DatabaseFor large amounts of data.

    Database accesses are expensive.

    Standardization required.Conversational Programming

  • Scratch Pad AreaAn IMS facility for terminal interactionsSPA is a work area to retain information from an application programA unique SPA for each physical terminalConversational Programming

  • SPA-IO-AREA01 SPA-IO-AREA.05 SPA-LLPIC S9(4) COMP.05 SPA-ZZPIC S9(4) COMP.05 SPA-CIPIC S9(4) COMP.05 SPA-TARN-CODEPIC X(8),05 SPA-USER-DATAPIC X(). Conversational Programming

  • SPAConversational Programming In a conversational program, the SPA must be retrieved before the message segments are retrieved.

    Then to retrieve the first segment of the input message issue a GN call.

  • Program Not Using SPARead input message ( GU + GNs )

    Process Message

    Insert output message ( ISRT )Conversational Programming

  • Program Using SPARead SPA ( GU )

    Read input message ( GNs )

    Process Message

    Insert SPA ( ISRT )

    Insert output message ( ISRT ) Conversational Programming

  • Program Using SPACALL CBLTDLI USING GU , IO-PCB-MASK, SPA-IO-AREA.

    CALL CBLTDLI USING GN , IO-PCB-MASK, INPUT-MESSAGE-AREA. ------------------------

    CALL CBLTDLI USING ISRT , IO-PCB-MASK, SPA-IO-AREA.

    CALL CBLTDLI USING ISRT , IO-PCB-MASK, OUTPUT-MESSAGE-AREAWS-MOD-NAME.

    Conversational Programming

    3/30/2009 9:00 AM *

    Advanced DC Programming

  • Advanced DC Programming

    IMS/VSLoggingWADSOLDSDBRC RECONRDSOLDSOLDSLogArchiveUtilitySLDSRLDSLogging in IMS DC

  • In the on-line environment,system log data sets are also part of logging system.

    There are several on-line log data sets, IMS uses one after another when one fills up with log records

    The main kind of log file in the DC environment is called as On-Line Log Datasets (OLDS).

    IMS uses a file called as Write-Ahead Dataset (WADS) to record log data temporarily that will be eventually stored in an OLDS.

    The WADS enables IMS to write OLDS only when enough log data has been accumulated to fill a block, at the same time not losing any data in event of failure

    Advanced DC ProgrammingLogging in IMS DC

  • DBRC RECON data set, identifies each OLDS and indicates whether its currently in use,is available for use,or is full of log data that should be archived.

    Once the OLDS gets filled, its contents are copied by IMS Log Archive Utility to an SLDS(system log data sets).

    In addition the utility copies the OLDS records to another log file called as Record Log Dataset (RLDS) used in database recovery.

    IMS uses data sets to enable it to recover from its own errors. When IMS restarts it stores information into a log file called the Restart Dataset (RDS)

    Advanced DC ProgrammingLogging in IMS DC

  • Advanced DC Programming A DC call (LOG call) can be issued for recording the information about a program error.

    CALL CBLTDLI USING LOG IO-PCB-MASK LOG-USR-DATA.Error Handling in MPP

  • Advanced DC Programming IMS default automatic recovery feature, reverses the changes the program has made.

    An alternative approach is to use ROLL or ROLB call to roll back the changes to the last sync point.

    Both the calls causes the data base updates made since last checkpoint to be reversed and cancels output messages inserted then.Error Handling in MPP

  • Advanced DC Programming CALL CBLTDLI USING ROLL.

    IMS terminates the program and disables it from being automatically scheduled again.

    After a program has issued the ROLL call, the system operator has to enable it explicitly before IMS will schedule it again.

    The input message that was being processed when the call was issued is deleted.Error Handling in MPP

  • Advanced DC Programming The ROLB call does not cause the program to be terminated, the program can continue to process other messages that are present in its queue.

    CALL CBLTDLI USING ROLB IO-PCB-MASK INPUT-MSG-AREA.

    The ROLB call can be used only in the programs that are specified to IMS to run in single processing mode.

    Error Handling in MPP

  • Advanced DC Programming The input message that was being processed may or may not be deleted depending on the format of the call.

    The input message thats currently processed is presented to the program in the specified I/O area in the call.

    If the ROLB call is issued without the I/O area the input message is likely to be deleted.Error Handling in MPP

  • Advanced DC ProgrammingPaging The facility that lets the messages be broken down into components for display, or for processing, or for both.

    Required when long and complex output messages are created.

    MFS provides two kinds of paging Physical Logical paging.

  • Physical Paging A message with a fixed number of segments is further subdivided into parts that are sized properly for a particular device.

    The screen layout is defined in three dimensional way

    Label DFLD [literal],POS=(line,column,page),ATTR=(--,--,--)

    Advanced DC Programming

  • Physical Paging Example:An application is designed to send an output message that fills a standard size 3270 model 2 (24,80) and some of the users use a 3270 model 1 display stations(12 lines)Advanced DC Programming DFLD for 24-line DFLD for 12-line TYPE=(3270,2) TYPE=(3270,1)

    FIELD1 DFLD POS=(3,12) FIELD1 DFLD POS=(3,12,1)FIELD2 DFLD POS=(6,12) FIELD2 DFLD POS=(6,12,1)FIELD3 DFLD POS=(9,12) FIELD3 DFLD POS=(9,12,1)FIELD4 DFLD POS=(10,12) FIELD4 DFLD POS=(10,12,1)FIELD5 DFLD POS=(15,12) FIELD5 DFLD POS=(3,12,2)FIELD6 DFLD POS=(18,12) FIELD6 DFLD POS=(6,12,2)FIELD7 DFLD POS=(21,12) FIELD7 DFLD POS=(9,12,2)

  • Physical Paging When an output message consists of multiple physical pages, MFS sends the first physical page first.

    The next page can be requested by an appropriate function key.

    The PF keys are enabled by coding the PFK parameter of the DEV statement.

    There may be only one DPAGE control statement, but the firlds would be defined in 3 dimensional layout

    Advanced DC Programming

  • Advanced DC ProgrammingPhysical PagingPPAGEXFMT DEVTYPE=(3270,2),X FEAT=IGNORE,X PFK=(PFKTEXT,5=NEXTPP,3=ENDMPPI) DIVTYPE=INOUT DPAGE CURSOR = ((3,12),(3,15)),MULT=YES DFLDPAGE 1 OF 2,POS=(1,25,1),ATTR=PROT,HI---------FIELD1DFLDPOS=(2,15,1),LTH=10,ATTR=MODFIELD2DFLDPOS=(4,15,1),LTH=8,ATTR=MOD------------------ DFLDPAGE 2 OF 2,POS=(1,25,2),ATTR=PROT,HI---------FIELD3DFLDPOS=(2,15,2),LTH=15,ATTR=MODFIELD4DFLDPOS=(4,15,2),LTH=30,ATTR=MOD------------------FMTEND

  • Logical Paging A logical page is associated with a single screen image with multiple occurrences of the same screen

    The pages could be with different data and different layout, as part of the output message.

    Logical paging is often used for applications that produce relatively large amounts of output.Advanced DC Programming

  • A logical page is simply a group of related fields,either on the terminal screen or in a message.

    A group of fields as seen on a device is a device page.

    The data thats received from or sent to a device page by an application program is called a message page.

    There would be multiple DPAGE and LAPGE statements and each LPAGE would be mapped to a corresponding DPAGE

    The Logical Field display is controlled by a logical page identifier fieldAdvanced DC ProgrammingLogical Paging

  • MOD MODNAMEMSGTYPE=OUTPUT,SOR=(DIFDOF,IGNORE),XPAGE=YES

    < LPAGENMLPAGE SOR=DPAGENM, > XCOND=(MFLDNANE, = , comparison ) Advanced DC ProgrammingLogical Paging

  • LPAGEXFMT DEVTYPE=(3270,2), FEAT=IGNORE, X PFK=(PFKTEXT,5=NEXTLP,3=ENDMPPI) DIVTYPE=INOUTDAPGE1 DPAGE CURSOR = ((3,12)) DFLDFIRST LOGICAL PAGE,POS=(1,25),ATTR=(PROT,HI)----------FIELD1DFLDPOS=(2,15),LTH=10,ATTR=MODFIELD2DFLDPOS=(4,15),LTH=8,ATTR=MOD--------------------DAPGE2 DPAGE CURSOR = ((4,25)) DFLDSECOND LOGICAL PAGE,POS=(1,25),ATTR=(PROT,HI)----------FIELD3DFLDPOS=(2,15),LTH=15,ATTR=MODFIELD4DFLDPOS=(4,15),LTH=20,ATTR=MOD--------------------FMTEND

    Advanced DC ProgrammingLogical Paging

  • LPAGEMODEMSGTYPE=OUTPUT,SOR=(LAPGEX,IGNORE),XNEXT=LPAGEMID,PAGE=YESLPAGE1 LPAGESOR=DPAGE1,COND=(LPAGEID,=,1) SEG LPAGEID MFLDLTH=1 MFLDFIELD1,LTH=10 MFLDFIELD2,LTH=8 ----------------LPAGE2 LPAGESOR=DPAGE2,COND=(LPAGEID,=,2) SEG LPAGEID MFLDLTH=1 MFLDFIELD3,LTH=15 MFLDFIELD4,LTH=20 ----------------MSGENDENDAdvanced DC ProgrammingLogical Paging

  • CommandAction =Move forward one logical page-1Move back to the previous Logical Page=nnn Move to logical page nnn=LMove to last logical page=-nnnMove backward nnn logical pages=+nnnMove forward nnn logical pages Advanced DC ProgrammingLogical Paging

  • Advanced DC ProgrammingScroll Down Scroll Up logic using Logical PagingCALL CBLTDLI GU IO-PCB-MASK INPUT-AREARETRIEVE REPORT OUTPUTFROM DATABASE / TABLE & POPULATE IN OUTPUT-AREA.COUNT THE NUMBER OF RECIS RECORDCOUNT = SCREENLINE LIMIT?CALL CBLTDLI ISRT IO-PCB-MASK OUTPUT-AREA WS-MOD-NAMESPACE OUT OUTPUT-AREASE THE RECORD COUNTERTO ZERONOYES

  • LPAGEXFMT DEVTYPE=(3270,2), FEAT=IGNORE, X PFK=(PFKTEXT,7==-1,8== ) DIVTYPE=INOUTDAPGE1 DPAGE CURSOR = ((3,12)) DFLDCSC TRAINING INFORMATION,XPOS=(1,25),ATTR=(PROT,HI)----------FIELD1DFLDPOS=(2,15),LTH=10,ATTR=MODFIELD2DFLDPOS=(4,15),LTH=8,ATTR=MOD--------------------DO10FIELD3DFLDPOS=(2,15),LTH=15,ATTR=MODFIELD4DFLDPOS=(4,15),LTH=20,ATTR=MOD--------------------ENDDOFMTEND

    Advanced DC ProgrammingScroll Down Scroll Up logic using Logical Paging

  • LPAGEMODEMSGTYPE=OUTPUT,SOR=(LAPGEX,IGNORE),XNEXT=LPAGEMID,PAGE=YESLPAGE1 LPAGESOR=DPAGE1 SEG MFLDFIELD1,LTH=10 MFLDFIELD2,LTH=8 ---------------- DO10MFLDFIELD3,LTH=15 MFLDFIELD4,LTH=20 ----------------ENDDOMSGENDENDAdvanced DC ProgrammingLogical Paging

  • IMS Transaction ManagerThank YouKamakshigari SureshTSPL

    *IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM*DLISAS is DLI Separate Address Space*IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM*IMS Control (IMSCTL) region is the core of an IMS System. IMSCTL includes system dependent regions and application dependent regions. System Dependent Regions are used to perform functions on behalf of IMSCTL and to relieve its processing constraints. Application Dependent Regions are used for executing application programs. System Dependent regions contain DBRC (Database Recovery Control) and DLI Separate Address Space. These address spaces are automatically started by IMSCTL. There can be only one instance of system dependent region. DBRC is must for IMS TM where as DLISAS is optional though majority of the system use it. DBRC contains codes for recovery services. DBRC uses Recovery Control (RECON) database to maintain database recovery information on behalf of IMSCTL. DLISAS performs most Full Function Database access functions or online transactions and allocates Full Function databases. It contains some database access control blocks and some in storage database buffers. Application dependent regions are started when a job or a transaction is started. IMSCTL schedules and dispatches application program into an application dependent region. Max no of Application Dependent region is 999. Three 3 types of Application Dependent Regions are MPR, IFPR and BMPR*IMS TM*IMS System Generator (IMSGEN) is used to build the resources that are required to run an individual IMS system. IMSGEN processes a series of Macros to define the IMS resources. These Macros can be customized by the user. IMSGEN is a two step process. A new IMSGEN process is required each time the resource definitions are amended or new definitions are added to the macros. Stage 1 of IMSGEN processes the Input Macros, validates their consistency, and produces a job stream of assembles and link edits. Stage 2 runs this job stream which produces the executable modules and non executable resource definitions to run the IMS TM. IMS should be closed to run the Stage 2 *IMS TM**IMS TM**IMS TM**IMS TM*Terminal can be defined as Physical Terminals and Logical Terminals. LTERMS are used by IMS for routing the messages to a TerminalThere are two types of Terminals Static and Dynamic.*IMS TM*Static Terminals are predefined in IMS. They describe the physical characteristics of each node or physical terminals including the Node Name. ie. Each LTERM will be mapped to a PTERM by defining the relationships in IMS registries. Hence all the terminals that are connected to the IMS system should be defined. Users cannot connect to IMS from any other system that is not defined in IMS. For static terminal, sign on is not mandatory*IMS TM*In the case of Dynamic Terminal, the mapping of LTERM to a particular PTERM is done dynamically. Such terminals forces user to sign on. Dynamic Terminals allows user to connect to IMS from a terminal that is not defined in IMS. Dynamic Terminals are created by Extended Terminal Option (ETO). The rules to create a dynamic terminal name can be set in ETO and it creates a dynamic terminal when the user connects to IMS TM from a terminal that is not defined in IMSGEN. ETO helps to remove the terminal definitions from IMSGEN, and therefore reduces the size of IMSGEN*IMS TM*IMS TM contains system dependent and application dependent regions. The over all TM environment is managed by MTO. MTO supports a series of commands that can temporarily change the status and most of the predefined characteristics of application, transaction and terminal definitions.*IMS TM*MTO manages and controls the user-terminal network, message scheduling environment and system control activities. MTO can modify user-terminal network through the relationship between LTERM and PTERM. MTO manages message scheduling by reassigning application and transaction priorities and starting and stopping the MPRs and databases. MTO controls various system control activities. /CHECKPOINT shuts down IMS TM. writes system information to system log. /NRESTART starts IMS TM following an orderly termination accomplished by /CHECKPOINT command. All /DIS, /START, /STOP commands are MTO commands. *IMS TM*There are 3 types of messages in IMS TM environment. Those are transactions, Message Switches and IMS Commands. *IMS TM*Transactions form majority of the IMS Messages. Transactions originate from either Terminal or Application Programs. Transactions are then sent to IMS input message queues from where they routed to the appropriate application programs for processing. *IMS TM*Maximum length allowed for transaction code and password is 8 bytes. Password is optional but if provided should be enclosed in brackets. *IMS TM*A message switch is used for management messages. A message switch allows IMS Terminal to communicate with each other. *IMS TM*If ETO is used, USER ID also can be provided instead of User ID*IMS TM*IMS Commands are used to control IMS operations. Commands are generally originated from either User Terminal or application programs*IMS TM*Commands are directly processed by IMS (MTO). *IMS TM**IMS TM*Message Queues are used to hold input transactions until they are routed to application programs or to hold output messages until they are routed to their destinations. All the Full Function transactions in IMS are processed by message queues. However Fast Path transactions do not use the standard IMS Message Queues. They use a separate IMS function called Expedited Message Handler (EMH). *IMS TM*The control region of the TM puts the incoming messages on the message queue and schedules the application program to run. The application program accesses and processes messages from the queue, and inserts the replies onto the message queue. The TM then takes the output messages from the queue and routes them to the appropriate destination. *IMS TM**IMS TM*Message Queues store messages by Destination, Priority and Time of Arrival. Message Queues allow TM to prioritize and balance the processing sequence of Input Messages. The priority control aspects of messages are defined during the installation of TM.*IMS TM*IMS provides various security features to prevent unauthorized access to its resources. It uses mainly two products for the purpose Security Maintenance Utility (SMU) and Resource Access Control Facility (RACF)*IMS TM*SMU is a security feature specific to IMS TM. It defines control statements for protecting IMS resources. SMU uses a dual matrix that defines the relationship between transactions, terminals and passwords. The control statements would be user written and the administrator puts those to SMU*IMS TM*RACF is an independent facility that runs under MVS operating system. It protects every aspects of an MVS system. The RACF maintains a unique identifier for each authorized users and user authenticates users through passwords. RACF can also assigns users appropriate levels of access to each resource. All the security information can be stored in a common database that is shared by all components of the MVS system*IMS TM*The APPLCTN macro allows you to define the program resource requirements for application programs that run under the control of the IMS DB/DC environment, as well as for applications that access databases through DBCTL. An APPLCTN macro combined with one or more TRANSACT macros defines the scheduling and resource requirements for an application program. Specifies whether (YES) or not (NO) this is a Fast Path-exclusive application program.SCHDTYP=Specifies whether (PARALLEL) or not (SERIAL) this application program can be scheduled into more than one message region or batch message region simultaneously. The default value is SERIAL.

    *IMS TM*The TRANSACT macro statement specifies the transaction codes that cause the application program named in the preceding APPLCTN macro to be scheduled for execution in an IMS message processing region. The TRANSACT macro statement is used one or more times with each APPLCTN macro statement to identify transactions as IMS exclusive, IMS Fast Path potential, or IMS Fast Path exclusive. MAXRGN=Limits the number of message processing program (MPP) regions that can be concurrently scheduled to process a transaction. When the number of MPP regions is not limited, one transaction might monopolize all available regions. If you specify zero, or if zero is defaulted to, no limit is imposed. The maximum number you can specify is 255.MSGTYPE=Specifies the type of transaction code (single or multiple segment), and whether the communication line from which the transaction is entered is to be held until a response is received. The MSGTYPE operands are not position dependent. The transaction code can be single segment (SNGLSEG), or multiple segment (MULTSEG). It specifies the time at which an incoming message is considered complete and available to be routed to an application program for subsequent processing. The defaults are (MULTSEG,NONRESPONSE,1).

    PRTY=Specifies the values that determine the scheduling priority of this transaction. This priority also controls the priority of messages created by this transaction and sent to a destination in a remote system. normalThe priority assigned to this transaction when the number of input transactions enqueued and waiting to be processed is less than the limit count value. The valid specification range is from 0 through 14. The default is 1. limitThe priority to which this transaction is raised when the number of input transactions enqueued and waiting to be processed is equal to or greater than the limit count value. The valid specification range is from 0 through 14. The default is 1.

    *IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM*A Conversational program uses special IMS facilities intended specially for maintaining data between terminal interactions. For storing data between terminal interactions, IMS provides scratch pad area or SPA. SPA is specifically enabled during the IMS system generation.A unique SPA is associated with the terminal thats running a conversational transaction. The program can use the data in the SPA to process the input. When an output message is saved, the SPA is saved so that it can be retrieved for the next terminal interaction.

    *IMS TM*The SPA begins with two binary half word fields LL and ZZ like the message segment. The SPA contains a third binary half word field which contains the Conversational identifier or CI, which IMS uses to keep track of the SPA.The CI identifies a control block called as Conversational control block or CCB that IMS maintains for conversations. The CCB relates SPA with the application program and the terminal.Never change the data in the CI field, although space is provided in the definition in SPA I/O area.Next is the eight bytes of data which contain the transaction code after that we can define data fields.

    *IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM*The first five bytes of the user data field have a rigid format. The fifth byte contains a code that identifies the record in the log data set.*IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM**IMS TM*The operator uses a PF key associated with the MFS operator command ENDMPPI to signal to MFS that the complete input message can be constructed and queued.

    To position the cursor at the specific locations for the data entry on the multiple input pages, multiple sub parameters of the CURSOR parameter (DPAGE statement) are coded.CURSOR = ((3,12),(3,15)),MULT=YESspecifies the cursor should be positioned at 3,12 in physical page 1 and 3,15 in physical page 2.

    *IMS TM**IMS TM*With operator logical paging, the terminal user has more control over which the logical pages of a message are displayed.The operator can enter the paging commands to decide which page MFS should display.For the operator to use logical paging a device field is uses to enter the paging commands and insure that the paging command is presented properly to MFS. The logical page identifier field must be at the beginning of the input message segment and must be of five characters long.*IMS TM*In MFS, a message field is identified that will contain the logical page selection indicator in the COND parameter of LPAGE statement.The COND parameter has three parts:The first Name of the field in the output message segment.The other two( a relational operator and a comparison value) specify a condition test that is applied to the field.TPAGELPAGESOR=(DEV1,DEV2)

    If the message descriptor has multiple LPAGE statements and none of the selection conditions they specify are true,then the last LPAGE in the MOD is selected.The COND parameter is hence avoided in the last LPAGE statement.Logical Paging works for MID also. For any input message, only one message page will be used even if several are defined.

    On the LPAGE statement that defines the message page for MID, the device page are related to it by SOR parameter.In a input message page, it possible to specify more than one device page in SOR parameter.

    *IMS TM*If an application creates output messages that have multiple logical pages we want to enable operator logical paging.To enable first we ensure PAGE = YES in the MSG statement that marks the beginning of MOD.This instructs MFS to examine related input messages for operator logical paging command*IMS TM*If an application creates output messages that have multiple logical pages we want to enable operator logical paging.To enable first we ensure PAGE = YES in the MSG statement that marks the beginning of MOD.This instructs MFS to examine related input messages for operator logical paging command*IMS TM**IMS TM**IMS TM*If an application creates output messages that have multiple logical pages we want to enable operator logical paging.To enable first we ensure PAGE = YES in the MSG statement that marks the beginning of MOD.This instructs MFS to examine related input messages for operator logical paging command*IMS TM*If an application creates output messages that have multiple logical pages we want to enable operator logical paging.To enable first we ensure PAGE = YES in the MSG statement that marks the beginning of MOD.This instructs MFS to examine related input messages for operator logical paging command*IMS TM*