*ASM XOPTS(CICS,SP,NOEDF,NOPROLOG,NOEPILOG) TAGTEST DFHEIENT TAGTEST AMODE 31 TAGTEST RMODE ANY * * This program demonstrates dynaTrace CICS ADK APIs. * * One group of APIs contains functions for starting and * ending a Purepath for the transaction and associated tagging * functions. A newer group of APIs permits nodes to be inserted * into a Purepath that is already in progress and to capture * its arguments or return value. The two groups of APIs are * unrelated, but they can be used within the same transaction. * * Start an initial path for this transaction. * * Note that a transaction that receives a tag from a program * running on another platform should start a linked path instead * so it can set a tag. For an example, see subroutine SUB1 * below. * -------------------------------------------------------------* CALL DTSPTF,(PATHNAME,PATH_LEN,CCSID),MF=(E,PLIST) LTR R15,R15 BZ DTSPTFOK MVC MSG_API,=CL8'DTSPTF' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DTSPTFOK DS 0H * -------------------------------------------------------------* * Note: * Any activity that occurs in this transaction between a start * path or start linked path API and the next DTEP API will be * associated with the started path. Optionally, insert link APIs * can be used to create tags to represent subpaths for children * of this transaction. The CICS agent automatically tags CICS * transactions started by DPL LINK or START requests made by any * traced transaction, so insert link is typically used to tag * service requests made to programs running on non-CICS * platforms. * -------------------------------------------------------------* * -------------------------------------------------------------* * Insert a link for a child path to trace a service request to a * program that will run on another platform. The tag length * must be initialized to the size of the buffer where the tag * will be returned. * -------------------------------------------------------------* LHI R4,L'BUFFER ST R4,TAG_LEN CALL DTILTF,(BUFFER,TAG_LEN),MF=(E,PLIST) LTR R15,R15 BZ DTILTFOK MVC MSG_API,=CL8'DTILTF' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DTILTFOK DS 0H * -------------------------------------------------------------* * Note: * Pass the tag that was obtained above to the service to * identify the path that it will set to report its activity. * -------------------------------------------------------------* * -------------------------------------------------------------* * End the initial path early because one transaction can't be * linked to two paths at once. Normally this API would be used * when the transaction is finished or when it wants to start * another path to trace a new unit of work. * -------------------------------------------------------------* CALL DTEP LTR R15,R15 BZ DTEPOK MVC MSG_API,=CL8'DTEP' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DTEPOK DS 0H * -------------------------------------------------------------* * To avoid the inconvenience of defining additional transactions * and programs, we will call an embedded subroutine here instead * of making a request to an external service. * -------------------------------------------------------------* LA R15,SUB1 CALL (15),(BUFFER,TAG_LEN),MF=(E,PLIST) * -------------------------------------------------------------* * Send a message to the terminal and return to CICS. * -------------------------------------------------------------* EXEC CICS SEND TEXT FROM(TERM_MSG) ERASE SR R15,R15 DFHEIRET SUB1 DS 0D STM R14,R12,12(R13) LA R15,SAVEAREA ST R13,4(,R15) ST R15,8(,R13) LR R13,R15 LM R4,R5,0(R1) * -------------------------------------------------------------* * Start the linked path. If your CICS transaction receives a * dynaTrace tag from another platform, a DTSLP* API is all that * is required to trace the transaction and any other CICS * transactions that it starts through a supported protocol. * -------------------------------------------------------------* CALL DTSLPTF,((R4),(R5)),MF=(E,PLIST) LTR R15,R15 BZ SLPTFOK MVC MSG_API,=CL8'DTSLPTF' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) SLPTFOK DS 0H * -------------------------------------------------------------* * Simulate calling another program by inserting another node * into the Purepath here. A Data Capture API is used to specify * a string argument. Note that these functions are unrelated * to the tagging functions that are also being demonstrated * elsewhere in this program. * * The token value must be retained and supplied on the matching * Exit API. If nested nodes are created, each will have its own * token and the most recent one must be exited first. * * Start by capturing an argument for the simulated program node. * -------------------------------------------------------------* CALL DTDCTF,(ARGUMENT,ARGLEN,ARGCCSID),MF=(E,PLIST) LTR R15,R15 BZ DCIARGOK MVC MSG_API,=CL8'DTDCTF' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DCIARGOK DS 0H * -------------------------------------------------------------* * Enter the simulated program. * -------------------------------------------------------------* CALL DTENTF,(NODENAME,NAMELEN,TOKEN),MF=(E,PLIST) LTR R15,R15 BZ ENTFOK MVC MSG_API,=CL8'DTENTF' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) ENTFOK DS 0H * -------------------------------------------------------------* * The application work associated with this program goes here. * -------------------------------------------------------------* * -------------------------------------------------------------* * End the program node that we added with a return code 8. * * Start by capturing the return value. * -------------------------------------------------------------* CALL DTDCI,(RC8),MF=(E,PLIST) LTR R15,R15 BZ DCIRETOK MVC MSG_API,=CL8'DTDCI' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DCIRETOK DS 0H * -------------------------------------------------------------* * Exit from the simulated program using the token from the most * recent Enter API. * -------------------------------------------------------------* CALL DTEX,(TOKEN),MF=(E,PLIST) LTR R15,R15 BZ EXOK MVC MSG_API,=CL8'DTEX' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) EXOK DS 0H * -------------------------------------------------------------* * End the linked path before returning. * -------------------------------------------------------------* CALL DTEP LTR R15,R15 BZ DTEP2OK MVC MSG_API,=CL8'DTEP' MVC MSG_TEXT,=CL16'API returned RC ' CVD R15,DWORD UNPK MSG_RC,DWORD OI MSG_RC+L'MSG_RC-1,X'F0' EXEC CICS WRITE OPERATOR TEXT(ERR_MSG) DTEP2OK DS 0H L R15,RC8 L R13,4(,R13) L R14,12(,R13) LM R0,R12,20(R13) BR R14 * Optional name to describe the initial path. PATHNAME DC CL24'Started from tagging ADK' PATH_LEN DC A(L'PATHNAME) CCSID DC F'0' NODENAME DC CL8'TESTPROG' Program name for the new node NAMELEN DC F'8' Program name length - up to 8 bytes ARGUMENT DC CL6'Hello.' Argument value associated with TESTPROG ARGLEN DC F'6' Length of argument above ARGCCSID DC F'0' Default CCSID RC8 DC F'8' Return value associated with TESTPROG TERM_MSG DC CL27'Assembler TAGTEST complete.' DFHEISTG ERR_MSG DS 0CL27 MSG_API DS CL8 MSG_TEXT DS CL16'API returned RC ' MSG_RC DS CL3 SAVEAREA DS 18F DWORD DS D TAG_LEN DS F TOKEN DS F Value that identifies the node on exit PLIST CALL ,(,,,),MF=L * Buffer to hold the tag that will identify a child path. * Note: DynaTrace 6.x requires a buffer of at least 77 bytes. BUFFER DS CL100 DFHEIEND DFHREGS END TAGTEST