Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Concept clarification only - Cobol Db2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Fri Oct 08, 2010 12:13 am    Post subject: Concept clarification only - Cobol Db2 program
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message

ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Fri Oct 08, 2010 1:25 am    Post subject:
Reply with quote

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
View user's profile Send private message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Fri Oct 08, 2010 1:35 am    Post subject:
Reply with quote

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
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Fri Oct 08, 2010 1:44 am    Post subject:
Reply with quote

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Fri Oct 08, 2010 3:13 pm    Post subject:
Reply with quote

Quote:
Because SP cannot access flat files on mainframe

yes, they can : SYSPROC.admin_ds_write :
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.admin/db2z_sp_admindswrite.htm
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Oct 08, 2010 3:15 pm    Post subject: Re: Concept clarification only - Cobol Db2 program
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 08, 2010 7:30 pm    Post subject:
Reply with quote

Hi Anuj,

Quote:
What host language you were using there?

Quote:
Concept clarification only - Cobol Db2 program
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Oct 08, 2010 7:53 pm    Post subject:
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Fri Oct 08, 2010 8:06 pm    Post subject:
Reply with quote

Thank you all, I'm happy to be back on Db2 :-)
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 08, 2010 9:10 pm    Post subject: Reply to: Concept clarification only - Cobol Db2 program
Reply with quote

Good luck icon_smile.gif

Someone will be here when there are questions,

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us