IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to call a cobol-db2 program from a cobol-db2 program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Fri Aug 18, 2006 5:14 pm
Reply with quote

can anybody just explain me how to call a cobol-db2 program from a cobol-db2 program with sample coding.
Back to top
View user's profile Send private message
senman

New User


Joined: 17 Aug 2006
Posts: 17
Location: Chennai

PostPosted: Fri Aug 18, 2006 8:16 pm
Reply with quote

As of my knowledge.... its usual as other normal calls to COBOL NonBB2 programs.

Call PGMNAME USING PARMLIST

If your case is different could you please elaborate on your query.
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Sat Aug 19, 2006 9:18 am
Reply with quote

Thanks senman for ur promt reply.
My problem is i get sub program load module not found while running my main program.
Please correct me if i am wrong
1. i compiled sub program & maxcc=0
2. compiled the main also & maxcc=0
3. Bind the sub program & maxcc=0
4.Bind the main program & maxcc=0
5.Then i am running the main program
it is saying subprogram load module is not found. But i checked my Load module pds both r there.
Please check my main program run jcl and correct it.

//SYSTSIN DD *
DSN SYSTEM(DSN1)
RUN PROGRAM(INSERT1) PLAN(FAC003) -
LIB('FAC003.WIPRO.LOADLIB')

do i need to write anything else?

Regards
satya123
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Sat Aug 19, 2006 9:27 am
Reply with quote

Please let me know can i call a cobol db2 program from a pure cobol program??? Then just send the process to follow( runjcl).
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Sat Aug 19, 2006 10:43 am
Reply with quote

Have you try putting the subprogram's name between quotes:

CALL "SUBPROGRAM" USING ....

Patrick
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Sat Aug 19, 2006 11:29 am
Reply with quote

THANX PATRIC IT IS WORKING NOW.

PLEASE DO REPLY THE SECOND QUESTION ....hOW TO CALL COBOL-DB2 PROGRAM FROM A COBOL PROGRAM..WHAT WILL BE THE RUNJCL?
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Sat Aug 19, 2006 4:13 pm
Reply with quote

The JCl will be the same as if you were calling a DB2 program from another DB2 program. The only exception is that you won't have to bind the main program because you don't have any SQL statement in it. But the JCL statement will be the same.

Patrick
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Mon Aug 21, 2006 8:55 am
Reply with quote

Dear Patrick,

Thanx for the reply. But can u bit precise of explaining the Process?

1.I precompiled,bind the sub program which is having sql in it.

2.Do i need to go for precompile ???? or compile ??? the main program which does not have any sql in it

3. what jcl to be used for running the main program i.e db2run jcl ??? or cobol run jcl???

Please answer these... Thanx in advance..

satya123
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Wed Aug 23, 2006 1:36 pm
Reply with quote

Hi Patrick, can you pleaseprovide answers for his queries. B'cos I also have same kind of problem. Please help us to know about it.

Thanks!
RAthna.
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Wed Aug 23, 2006 6:07 pm
Reply with quote

Hi Rathna,
Have u tried with cobol-db2 program calling cobol-db2 program?? Can u just send me a sample program and the processing of program???
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Thu Aug 24, 2006 1:38 am
Reply with quote

HI Satya,

You have to:
1) Precompile +compile (DB2) you sub program
2) Bind your subprogram (BIND PLAN OU BIND PACKAGE)
3) Compile your cobol main program
4) Run the main program with the DB2RUN JCL

In general, you would do the exact same action than if you would have a DB2 program calling an DB2 subprogram except that you don't precompile and bind your main program because there is no SQL in it.

Is that clear enougth?

Best regards

Patrick
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Thu Aug 24, 2006 8:56 am
Reply with quote

Hi Patric,

Really it works and thanks a lot.

Please do tell me the process of calling a cobol-db2 program to cobol-db2 program. I need the run jcl.

please explain the process.

satya123
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Fri Aug 25, 2006 1:02 am
Reply with quote

HI Satya,

You have to:
1) Precompile +compile (DB2) you sub program
2) Precompile +compile (DB2) you main program
3) BIND PLAN (the pklist should contains both the main and the sub program DBRM (same name thant the source))
4) Run the main program with the DB2RUN JCL

Patrick
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Fri Aug 25, 2006 9:06 am
Reply with quote

Hi Patric,
Thanx a lot for the reply....Really it is working fine.
I have one more doubt can we have ISAM file in mainframe??? If yes then how to create it/???????

Thanks
satya123
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top