View previous topic :: View next topic
|
Author |
Message |
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Hi,
I am getting back to Db2 environment after a long time. Needed clarifications on few doubts-
a) Can I use DB2 tables in batch programming like I use them in Stored Procedures ? What is the difference between the two?
b) I'm using changeman for release and version control within my application. I added my Cobol-DB2 program as a SRA component, when do I need to add the DBB component ? And do I always need to add the PKG component as well? Currently, while in DEV, I am using precompiler 'YES' option to pre-compile & compile my program and it is becomming active in my package.
Hope I'm making sense, please ask me questions in case anything is not clear above. It'll help me in fact.
Thanks |
|
Back to top |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi Arien,
Here are the answers for your queries
a) Can I use DB2 tables in batch programming like I use them in Stored Procedures ? What is the difference between the two?
Yes you can use DB2 tables in batch programs. Batch programs written in host language like COBOL are independent programs and are not stored as part of Database. Batch programs makes calls to DB2 to retrieve or update information. A predefined access path is generated while compiling and binding a batch program.
DB2 Stored Procedures are stored as part of Database. Application program calling DB2 Stored Procedure will make only one call and whole Stored Procedure will execute on the DB2 Server. This way we can prevent multiple calls to DB2 which causes network traffic and multiple authentication check.
b) I am not a Changeman user. I donno about it. But while writing a COBOL DB2 program you should precompile--> Compile ---> BIND program. PKG option looks like a package which will have actual DB2 calls.
Thanks,
Reddy |
|
Back to top |
|
|
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Thanks Reddy, my primary purpose is to unload a table into pipe-delimited flat file and apply some formatting to it which retrieving each row, hence I thought of writing it in a batch.
Another reason, which if you can confirm is, that SPs are called from Front end (like Java interface etc) and batch processing happens on Mainframes/DB2. Is that so ?
Considering my program purpose, could I code it as a SP as well ? |
|
Back to top |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
You are correct SPs are called from Front end as well as backend too (like Java interface etc) and batch processing happens on Mainframes/DB2.
If you want to deal with a flat file and DB2 I suggest Batch program only. Because SP cannot access flat files on mainframe.
Thanks,
Reddy |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
arien wrote: |
a) Can I use DB2 tables in batch programming like I use them in Stored Procedures ? What is the difference between the two? |
What host language you were using there?
Quote: |
b) I'm using changeman for release and version control within my application. I added my Cobol-DB2 program as a SRA component, when do I need to add the DBB component ? And do I always need to add the PKG component as well? Currently, while in DEV, I am using precompiler 'YES' option to pre-compile & compile my program and it is becomming active in my package. |
Change-Man set-up is pretty site-specific. What SRA means to you might mean SR2 to me and may be SRB at other shop, so mention about that does not really help us to help you. Suggest you get in contact with someone at your shop or contact Change-Man admin - they will be able hit direcly on the nail to solve your questions. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Quote: |
What host language you were using there? |
Quote: |
Concept clarification only - Cobol Db2 program |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks Dick.
I was skeptical about the origin of the question, which I quote in my last post. When I last worked on DB2 SPs, there were folks from "Front-end" team, who used to "call the SP" from their JAVA-modules. And they never understood how COBOL and DB2 work with each-other. But if the OP has worked with COBOL and DB2 in creating the SPs - programming is pretty-similar. |
|
Back to top |
|
|
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Thank you all, I'm happy to be back on Db2 :-) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good luck
Someone will be here when there are questions,
d |
|
Back to top |
|
|
|