Following steps needs to followed to write a stored Proc in DB2:
1) You can write DB2 sPs using COBOL,Java etc..
In case of COBOL,define your input and output parameters
in the linkage section.
The pgm flow will be the same as any COBOL pgm except :
a) There will be no statements like 'STOP'
b) Usually Cursor is not fetched in the pgm,,it is just opened
to write result sets in SPAS[Stored Proc Addres Space]
2) Stored Proc Crete Statements should be done.
3) Stored Proc needs to be defined in DB2 catalog and OS 390 WLM[Work