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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to call a cobol-db2 program from a cobol-db2 program
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: How to call a cobol-db2 program from a cobol-db2 program
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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