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
 

 

Main Program in Cobol and Sub program with Cobol -Db2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kmdhandapani

New User


Joined: 13 Jul 2007
Posts: 10
Location: india

PostPosted: Thu Apr 10, 2008 2:50 pm    Post subject: Main Program in Cobol and Sub program with Cobol -Db2
Reply with quote

Hi ,

i have Program name ASF00001 is cobol and Sub Program with ASF00022 in Cobol -Db2 ..

Now i am modifying in both calling & Called program ..

How can i compile programs ..

kindly let me know the process ???
Back to top
View user's profile Send private message

acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Apr 10, 2008 2:58 pm    Post subject:
Reply with quote

in general, every site has it's own jcl/skeleton/utility to do it... ask your peers.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Apr 11, 2008 3:57 pm    Post subject: Reply to: Main Program in Cobol and Sub program with Cobol
Reply with quote

dhandapani,

There are many ways to compile. It is all specific to your project/site. Some use JCL's , few compile in endevor/changeman .
Back to top
View user's profile Send private message
kmdhandapani

New User


Joined: 13 Jul 2007
Posts: 10
Location: india

PostPosted: Fri Apr 11, 2008 4:26 pm    Post subject: Reply to: Main Program in Cobol and Sub program with Cobol
Reply with quote

yes we can compile Sub program Seperate and Main prgram Seperate by endevour / Changman

But how can we Run Jcl ? Because we have Seperate jcl to Run Cobol ,Cobol -Db2 .


Regards,
Dhans
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Apr 11, 2008 5:19 pm    Post subject:
Reply with quote

you should use IKJEFT01 to invoke your main program...
RUN PROGRAM(yourprogramhere)
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 Apr 11, 2008 8:54 pm    Post subject:
Reply with quote

Hello,

Quote:
But how can we Run Jcl ? Because we have Seperate jcl to Run Cobol ,Cobol -Db2 .
You should talk with others on your project who run programs or the database support people for the proper jcl for your system. You should not just make-up or download some jcl from elsewhere.
Back to top
View user's profile Send private message
Mistermind
Warnings : 2

New User


Joined: 08 Feb 2008
Posts: 46
Location: Dublin

PostPosted: Sun Apr 13, 2008 4:24 am    Post subject:
Reply with quote

I would think your main program should be compiled like a DB2 program, i.e. going through the preprocessor, outputting DBRM for binding.

At runtime, JCL exec pgm=IKJEFT01 which invokes the main program, which then calls the subroutine statically or dynamically. The DB2 subroutine will not execute correctly unless the DB2 environment has been set up for the main program before the subroutine is activated.

If both are old programs, check the existing compile output and runtime JCL to confirm the above is the arrangement. If Endevor is used, check the processor groups previously used and ascertain the actions performed by the processor groups.

If these two programs are being connected for the first time, then implement the above, i.e. compile the main program as DB2. At runtime the main program does not HAVE to call the DB2-using subroutine, the main program can run to the end without ever using DB2.
Back to top
View user's profile Send private message
Sundar V

New User


Joined: 25 Apr 2006
Posts: 5

PostPosted: Mon Apr 14, 2008 12:06 pm    Post subject:
Reply with quote

Hi

Could you please explain more why the Main program need to compile as COBOL-DB2 Program, even it doesnt have any DB2 Statements.

1. What will happen if i compile my Mainprogram as a pure COBOL program (IGYCRCTL) which calls a COBOL-DB2 Subprogram?
Secondly if i try to execute/run my main program (which is compiled using IGYCRTCL) using IKJEFT01,
then whether my both main and subprogram get executed?

Or Will it get abort during run/execution?

2. As Mistermind mentioned, if i compile the Mainprogram (NO DB2 Statement) as similar to COBOL DB2 program,
then there wont be DBRM created, no need for Bind, and no consistency token check during execution.

If this is a case, why are we choosing the mainprogram to compile in COBOL-DB2 mode?

Please clarify.

Thanks in advance.

Sundar
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Apr 14, 2008 12:28 pm    Post subject:
Reply with quote

do not db2 pre-compile a program that contains no db2. dumb, dumb, dumb.


your main program calls the sub program. IKJEFt.. invokes you main program after making a connection to db2.

That is the purpose of using IKJEFT.. First it connects to db2 with the plan for the db2 submodule and then invokes the main module, which will eventually call the submodule.

The OP (and a couple of the contributors) need to read a little about what is going on in the computer, control and invocation of db2 modules.
Back to top
View user's profile Send private message
kmdhandapani

New User


Joined: 13 Jul 2007
Posts: 10
Location: india

PostPosted: Mon Apr 14, 2008 1:08 pm    Post subject: Reply to: Main Program in Cobol and Sub program with Cobol
Reply with quote

thanks a lot for your help and its working fine

i compiled main program just like a Cobol -Db2 program ..and at run Program with IKJEFTO1 ..


regards,
Dhans.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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