If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 mainframe external stored procedure help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-30-04, 21:01
archanabharathi archanabharathi is offline
Registered User
 
Join Date: Nov 2004
Posts: 1
Question DB2 mainframe external stored procedure help

I am using DB2 Mainframe V8 (z/OS).

I have an external stored procedure written in C. I have already compiled the C program and have obtained the binaries corresponding to the SQL part and the C part. Currently I copy the binaries as members of the DSN810.DBRMLIB.DATA and DSN810****NLIB.LOAD datasets respectively and then run the JCL for invoking them.

Can I copy the binaries to some other location and still run it correctly (i.e. still make sure the correct libraries are used etc.)? If yes, what are the changes I need to make to the JCL? This is the JCL I am using currently (ABC.ABC0 is the stored procedure and ABC0 is the C source file). Any input will be really appreciated. Thanks!!

//*
//DSN810 JCLLIB ORDER=DSN810.PROCLIB
//*
//JOBLIB DD DSN=CEE.SCEERUN,DISP=SHR
// DD DSN=DSN810.SDSNEXIT,DISP=SHR
// DD DSN=DSN810.SDSNLOAD,DISP=SHR
// DD DSN=DSN810****NLIB.LOAD,DISP=SHR
//*
//*******************************************
//* STEP 1: DROP OBJECTS
//*******************************************
//PH06TS01 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB8G)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIA81) -
LIB('DSN810****NLIB.LOAD') -
PARM('RC0')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *

DROP PROCEDURE ABC.ABC0 RESTRICT;
COMMIT;

//*
//********************************************
//* STEP 2: CREATE OBJECTS
//********************************************
//PH06TS02 EXEC PGM=IKJEFT01,DYNAMNBR=20,
// COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB8G)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIA81) -
LIB('DSN810****NLIB.LOAD')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *

CREATE PROCEDURE
ABC.ABC0(
IN VARCHAR(4096) CCSID EBCDIC,
OUT INTEGER,
OUT INTEGER,
OUT INTEGER,
OUT VARCHAR(880) CCSID EBCDIC )
LANGUAGE C
DETERMINISTIC
MODIFIES SQL DATA
EXTERNAL NAME ABC0
PARAMETER STYLE GENERAL WITH NULLS
COLLID ABC
WLM ENVIRONMENT DB8GENV1
ASUTIME LIMIT 50
STAY RESIDENT NO
PROGRAM TYPE MAIN
SECURITY DB2
NO DBINFO
RESULT SET 1
COMMIT ON RETURN NO;

//*
//**************************************************
//* STEP 3: BIND THE STORED PROCEDURE PACKAGE
//**************************************************
//PH06TS04 EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
//DBRMLIB DD DSN=DSN810.DBRMLIB.DATA,
// DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB8G)
BIND PACKAGE(ABC) -
MEMBER(ABC0) ACT(REP) ISO(CS) ENCODING(EBCDIC)
//*
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On