Call COBOL-DB2 program from pure COBOL program?
-
- New Member
- Posts: 7
- Joined: Mon May 23, 2016 10:39 am
Call COBOL-DB2 program from pure COBOL program?
Hi,
Did someone try to call COBOL-DB2 program from pure COBOL program? I have been asked this in an interview whichI could not answer in a good manner.
Can anyone of you please tell me what all things needsto be included in the RUN JCL? Bind should be done for called program only, as per my understanding, is this correct?
Did someone try to call COBOL-DB2 program from pure COBOL program? I have been asked this in an interview whichI could not answer in a good manner.
Can anyone of you please tell me what all things needsto be included in the RUN JCL? Bind should be done for called program only, as per my understanding, is this correct?
Re: Call COBOL-DB2 program from pure COBOL program?
What is "pure" cobol?
To access any database from any language you need statements that are specific to that database. These are, generally, extensions to the language and so, perhaps, you could say that such programs are impure.
To access any database from any language you need statements that are specific to that database. These are, generally, extensions to the language and so, perhaps, you could say that such programs are impure.
Regards
Nic
Nic
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Call COBOL-DB2 program from pure COBOL program?
it is usually accepted that it means ( on the forums )
having a &MAIN cobol program ( with no db2 calls ) calling a COBOL subroutine which does some DATABASE I/O
DB2 does not care about the logic flow of the program
( who calls who )
DB2 cares only about the correspondence between the DBRM in the PLAN/PACKAGE and the subroutines used/invoked
since a NON DB2 program does not have a DBRM
no need to mention it' s name anywhere
having a &MAIN cobol program ( with no db2 calls ) calling a COBOL subroutine which does some DATABASE I/O
DB2 does not care about the logic flow of the program
( who calls who )
DB2 cares only about the correspondence between the DBRM in the PLAN/PACKAGE and the subroutines used/invoked
since a NON DB2 program does not have a DBRM
no need to mention it' s name anywhere
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: Call COBOL-DB2 program from pure COBOL program?
Hi enrico,
Good to see you here!
If we are running the program under batch TSO (via program IKJEFT01), don't we need the non DB2 program name in the RUN program-name command in the SYSTSIN card?
Good to see you here!
If we are running the program under batch TSO (via program IKJEFT01), don't we need the non DB2 program name in the RUN program-name command in the SYSTSIN card?
Love is like an hourglass, with the heart filling up as the brain empties - Jules Renard.
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Call COBOL-DB2 program from pure COBOL program?
Hello Arun,
nice to see You on this new playground
You just need the name of the load module ...
nobody knows after how many calls the call to db2 will be done
nice to see You on this new playground
You just need the name of the load module ...
nobody knows after how many calls the call to db2 will be done
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: Call COBOL-DB2 program from pure COBOL program?
True, so in this case I am assuming the name of the load module would be the one generated from the "pure COBOL program".
Thanks enrico. I wanted to say hi to our old friend Anuj too, but looks like private messaging is blocked for me, I think he is mad at inactive membersenrico-sorichetti wrote:nice to see You on this new playground
Love is like an hourglass, with the heart filling up as the brain empties - Jules Renard.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Call COBOL-DB2 program from pure COBOL program?
Just my $.02 ...
The classic answer is follow the standards at your shop - however, as this is an interview question, so, benefit-of-doubt goes to the TS - You should Compile the main program as a standard non-DB2 program. "Compile", i.e. - (pre)compile and compile the DB2-sub-program. BIND it as a standard DB2 program. Now the main part - execute main-program in JCL as if it was a standard DB2 program with the plan name that has the collection for your DB2-sub-program.
The classic answer is follow the standards at your shop - however, as this is an interview question, so, benefit-of-doubt goes to the TS - You should Compile the main program as a standard non-DB2 program. "Compile", i.e. - (pre)compile and compile the DB2-sub-program. BIND it as a standard DB2 program. Now the main part - execute main-program in JCL as if it was a standard DB2 program with the plan name that has the collection for your DB2-sub-program.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Call COBOL-DB2 program from pure COBOL program?
Parity bit is still in control!Arun Raj wrote:Thanks enrico. I wanted to say hi to our old friend Anuj too, but looks like private messaging is blocked for me, I think he is mad at inactive members
Inactive are better than spammers - after 3rd message, I think you should be able to send the PMs.
Yes, nice to see you!
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: Call COBOL-DB2 program from pure COBOL program?
and the RUN program-name with the load module name from the non-DB2 calling program.with the plan name that has the collection for your DB2-sub-program
Love is like an hourglass, with the heart filling up as the brain empties - Jules Renard.
Re: Call COBOL-DB2 program from pure COBOL program?
Lol. Thanks Anuj and same here, I actually tried the "Send Email" feature to reach you, but not sure if those really "reached".
Love is like an hourglass, with the heart filling up as the brain empties - Jules Renard.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Call COBOL-DB2 program from pure COBOL program?
They do reach to me but could not really look at them lately. Had been working round the clock. Earning to pay the bills is not easy, I tell you!
Please check, you should be able to send the PMs now. Hopefully TS is not annoyed, we have hijacked this topic quite a bit, I think...!
Please check, you should be able to send the PMs now. Hopefully TS is not annoyed, we have hijacked this topic quite a bit, I think...!
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Website Team
- Posts: 70
- Joined: Wed Jul 31, 2013 10:19 pm
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Call COBOL-DB2 program from pure COBOL program?
one thing to remember ...
THERE IS NO RELATION WHATSOEVER BETWEEN THE DB2 PLAN/PACKAGE AND THE PROGRAM USING IT
as long as the PLAN/PACKAGE contains all the DBRMs of the things effectively called/used
many years a customer of mine discovered after six months an error ( missing dbrm )
because the module called was dealing with a situation that did never occur before
AFAIK it might be different now
THERE IS NO RELATION WHATSOEVER BETWEEN THE DB2 PLAN/PACKAGE AND THE PROGRAM USING IT
as long as the PLAN/PACKAGE contains all the DBRMs of the things effectively called/used
many years a customer of mine discovered after six months an error ( missing dbrm )
because the module called was dealing with a situation that did never occur before
AFAIK it might be different now
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute