!!!! Mainframe Samples !!!!


Program (source code) Description
COBDYNA.txt Dynamic SQL update
COBDYNB.txt Dynamic SQL fetch
COBDYNC.txt Dynamic SQL fetch using SQLDA
DB2CBLN.txt Multi-row fetch cursor
DB2SCRL.txt Scrollable cursor
DB2UPDT.txt Update cursor

DB2CALLSP.txt

SP_MEDIAN_RESULT_SET.txt

Call Db2 Native SQL Stored Procedure with result set

SQL for MEDIAN_RESULT_SET Stored Procedure

DB2PROC.txt

SP_GET_EMP_NAME.txt

SP_RETURN_DEPT_SALARY.txt

Call Db2 Native SQL Stored Procedure

SQL for GET_EMP_NAME Stored Procedure

SQL for RETURN_DEPT_SALARY Stored Procedure

Program (Source Code) Description
db2panda.py Create Panda DataFrame
db2parm.py Prepare and execute SQL statements with variable input
db2proc.py Call Db2 Native SQL Stored Procedure
logindata.py Db2 login details (update as required)

Program (Source Code) Description
data.properties Java properties file (update as required)
READEMP.txt SQL for READ_EMP Stored Procedure
db2seldata.java Read Db2 data using JDBC
db2proc.java Call Db2 Native SQL Stored Procedure
db2procparm.java Call Db2 Native SQL Stored Procedure with parameters

Program (source code) Description
db2server_php.txt Db2 connection parameters (update as required)
db2sel_php.txt Prepare and execute SQL statements
db2fetch_php.txt Read Db2 data using $_GET input variable
db2callproc_php.txt Call Db2 Native SQL Stored Procedure with parameters
db2selparm_php.txt Prepare and execute SQL statements with variable input

Program (source code) Description
db2static.sqc Run static SQL
db2dynamic.sqc Run dynamic SQL
db2callproc.sqc Call Db2 Native SQL Stored Procedure with parameters
db2callprocset.sqc Call Db2 Native SQL Stored Procedure with result set

Program (source code) Description
REXX_Db2_Select.txt Run Db2 Select SQL
REXX_Db2_Update.txt Run Db2 Update SQL (multiple rows using cursor)
REXX_Db2_SP.txt Call Db2 Native SQL Stored Procedure with parameters
REXX_Db2_SP_Set.txt Call Db2 Native SQL Stored Procedure with result set

Program (source code) Description

EMPDTL1C.txt

SP_EMPDTL1C.txt

CALDTL1C.txt

COBOL code for Stored Procedure

SQL for Stored Procedure (Parameter Style General)

COBOL program to invoke Stored Procedure : EMPDTL1C

EMPDTL2C.txt

SP_EMPDTL2C.txt

CALDTL2C.txt

COBOL code for Stored Procedure

SQL for Stored Procedure (Parameter Style General with Nulls)

COBOL program to invoke Stored Procedure : EMPDTL2C

EMPDTL3C.txt

SP_EMPDTL3C.txt

CALDTL3C.txt

COBOL code for Stored Procedure

SQL for Stored Procedure (Parameter Style DB2SQL)

COBOL program to invoke Stored Procedure : EMPDTL3C

EMPDTL4C.txt

SP_EMPDTL4C.txt

CALDTL4C.txt

COBOL code for Stored Procedure

SQL for Stored Procedure (Parameter Style DB2SQL with DBINFO)

COBOL program to invoke Stored Procedure : EMPDTL4C

GETEMPDT.txt

SP_GETEMPDT.txt

CALEMPDT.txt

COBOL code for Stored Procedure

SQL for Stored Procedure

COBOL program to invoke Stored Procedure : GETEMPDT

Program (source code) Description

REXX_EXT_SP.txt

REXX_EMPDTLSR.txt

SQL for External Stored Procedure EMPDTLSR

REXX code for EMPDTLSR

REXX_EXT_SP_RS.txt

REXX_EMPRSETR.txt

SQL for External Stored Procedure returning a result set

REXX code for EMPRSETR

Program (source code) Description

EMPDTL1P.txt

SP_EMPDTL1P.txt

CALDTL1P.txt

C code for Stored Procedure

SQL for Stored Procedure (Parameter Style General)

C program to invoke Stored Procedure : EMPDTL1P

EMPDTL2P.txt

SP_EMPDTL2P.txt

CALDTL2P.txt

C code for Stored Procedure

SQL for Stored Procedure (Parameter Style General with Nulls)

C program to invoke Stored Procedure : EMPDTL2P

EMPRSETP.txt

SP_EMPRSETP.txt

CALRSETP.txt

C code for Stored Procedure

SQL for Stored Procedure (Parameter Style General with Nulls returning a Result Set)

C program to invoke Stored Procedure : EMPRSETP

Program (source code) Description

EmpDtlsJ.java

SP_EmpDtlsJ.txt

CalDtlsJ.java

JAVA code for Stored Procedure

SQL for Stored Procedure (Parameter Style JAVA)

JAVA program to invoke Stored Procedure : EmpDtlsJ

EmpRsetJ.java

SP_EmpRsetJ.txt

CalRsetJ.java

JAVA code for Stored Procedure

SQL for Stored Procedure (Parameter Style JAVA returning a Result Set)

JAVA program to invoke Stored Procedure : EmpRsetJ

EmpDtl1J.sqlj

SP_EmpDtl1J.txt

SQLJ code for Stored Procedure

SQL for Stored Procedure (Parameter Style JAVA)

EmpRst1J.sqlj

SP_EmpRst1J.txt

SQLJ code for Stored Procedure

SQL for Stored Procedure (Parameter Style JAVA returning a Result Set)

Program (source code) Description
SP_EMPDTLSS.txt SQL for Stored Procedure EMPDTLSS
SP_EMPRSETS.txt SQL for Stored Procedure returning a result set

Name Type (JCL/PROC) Description
JCL_COBCOMP.txt JCL Compile, Link-Edit & Run a COBOL program (No Db2 access) 
JCL_DB2COMP.txt JCL Pre-Compile, Compile, Link-Edit & Bind a COBOL program (with Db2 access). For External Stored Procedure program use “INCLUDE SYSLIB(DSNRLI)” in SYSIN of Link-Edit step.
JCL_COMPC.txt JCL Compile, Link-Edit & Run a C program (No Db2 access)
JCL_DB2COMPC.txt JCL Pre-Compile, Compile, Link-Edit & Bind a C program (with Db2 access). For External Stored Procedure program use “INCLUDE SYSLIB(DSNRLI)” in SYSIN of Link-Edit step.
JCL_COMPSQLP.txt JCL Compile, Link-Edit & Bind a Db2 SQL Stored Procedure
JCL_DB2JAVA.txt JCL Compile & Run a Java program (with Db2 access)
JCL_BINDPLAN.txt JCL Bind a Db2 Plan
JCL_BINDPKG.txt JCL Bind a Db2 Package
JCL_DB2_Run.txt JCL Run a Db2 program
JCL_VSAMALT.txt JCL Create VSAM & Alternate Index
JCL_OCOPY.txt JCL Copy data between an MVS data set and the z/OS UNIX file system
JCL_REXXCMP.txt JCL Compile, Link-Edit & Run a REXX program of OBJ type
PROC_DB2COMP.txt PROC Pre-Compile, Compile, Link-Edit & Bind a COBOL program (with Db2 access). For External Stored Procedure program use “INCLUDE SYSLIB(DSNRLI)” in SYSIN of Link-Edit step.
PROC_DSNHC.txt PROC Pre-Compile, Compile, Link-Edit & Bind a C program (with Db2 access). For External Stored Procedure program use “INCLUDE SYSLIB(DSNRLI)” in SYSIN of Link-Edit step.
PROC_DSNHSQL.txt PROC Compile, Link-Edit & Bind a Db2 SQL Stored Procedure
PROC_CBCXCB.txt PROC Compile & Link-Edit a C program (No Db2 access)
PROC_REXXCL.txt PROC Compile & Link-Edit a REXX program of OBJ type

SORT/ICETOOL JCLs: ……Coming soon……


REXX/CLIST: ……Coming soon……