Db2 for z/OS on IBM Z - Group home

How useful is to use Db2 Stored Procedures for z/OS?/DSNACICS

  

How useful is to use Db2 Stored Procedures for z/OS?/DSNACICS

Most Stored Procedures expose Db2 objects like Db2 table information. But what about information stored in VSAM files? Some data centers still use these resilient files to store their business data. According to IBM'PDFs you can use external Stored Procedures to expose information in VSAM files. One way is through the DSNACICS Stored Procedure. This is a Db2 provided Stored Procedure. DSNACICS runs in a particular WLM associated with the Db2 sub system and connect with the cics program that read the VSAM file. DSNACICS has to be called by the external Stored Procedure and need a set of specific parameters:

PARM_LEVEL INTEGER, value 1
PGM_NAME CHAR(8), contains the name of the Cics program that access the Vsam file
CICS_APPLID CHAR(8), contains the name of the Cics
CICS_LEVEL INTEGER, value 2
CONNECT_TYPE CHAR(8), indicates whether the Cics connection is generic or specific
NETNAME CHAR(8), Spaces 
MIRROR_TRANS CHAR(4), Spaces
COMMAREA VARCHAR(32704), contains the commarea between the Stored Procedure and the Cics program
COMMAREA_TOTAL_LEN INTEGER, indicates the Commarea's Length
SYNC_OPTS INTEGER, 1 when the Calling application controls the two-phase commit or 2 when Cics will commit at the end of Transaction
RETURN_CODE INTEGER, Return code
MSG_AREA VARCHAR(500) , it is an output parameter that contains any message error

So you need to CALL the DSNACICS Stored Procedure from your own external Stored procedure passing exactly these parameters and with the indicated types. In the next and last part of this Db2 Stored Procedures history I will tell you about the response time and the CPU consumption.


#ibmchampions-highlights #ibmchampions-highlights-home