View previous topic :: View next topic
|
Author |
Message |
nasser_tice
New User
Joined: 28 Nov 2006 Posts: 19 Location: India
|
|
|
|
Hi All,
I have one question. Can we communicate/call the subprogram without having the 'USING' pharse in the 'PROCEDURE DIVISION' of the called subprogram??
Or is that any other way of calling the subprogram other than using the 'USING' word in the PROCEDURE DIVISION??
Thanks in advance
Mohammed Nasser. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
search for CEE3PRM—Query parameter string |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
Back to top |
|
|
nasser_tice
New User
Joined: 28 Nov 2006 Posts: 19 Location: India
|
|
|
|
Hi,
The link you have provided describes the usage of 'USING' phrase. It has nothing to do with my question.
My question is whether is there any possible way of calling/invoking/communicating the program A to program B without having the 'USING' phrase in PROCEDURE DIVISION of a COBOL program. |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
AGAIN
|
|
Back to top |
|
|
nasser_tice
New User
Joined: 28 Nov 2006 Posts: 19 Location: India
|
|
|
|
Acevedo,
Hmm.. it is a bit unclear what this
CEE3PRM--(--char_parm_string--,--fc--) will do. I have never seen before this usage.
Is it a COBOL function. or a JCL one/
Can you please brief about what this is?
Anybody has any views on my question? |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
CEE3PRM it's a Language Environment Callable Service that you can invoke in order to avoid coding the undesired USING clause in the Procedure Division. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Take a look at EXTERNAL WORKING-STORAGE. When defined exactly the same way in PGM "A" and "B" (in this example, both of these programs are considered a "Run Unit"), when "A" calls "B" and "B" populates this EXTERNAL data, "A" now has the same data in its EXTERNAL fields. No parm required when "A" calls "B" and "B" doesn't need a USING at the PROCEDURE DIVISION level.
EXTERNAL was introduced with with COBOL2, version 3 or COBOL/370.
You can also have EXTERNAL files as well as other definitions.
It would be worth the research to review this....
HTH....
Regards,
Bill |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
nasser -
Why do you want to do this? |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Yes. You can code
instead of
Code: |
PROCEDURE DIVISION USING VARIABLES |
Use the
in the called program to communicate the inputs and outputs of the subroutine.
Call the subroutine as
Code: |
CALL 'SUBROUTINE' USING VARIABLES |
|
|
Back to top |
|
|
nasser_tice
New User
Joined: 28 Nov 2006 Posts: 19 Location: India
|
|
|
|
Hi Bharat,
Are you sure you can code the above statements. I mean without 'USING' phrase in PROCEDURE DIVISION. Please let me know if you have tried it and didnt get any compilation errors.
Hi Phil,
I was asked this question in an interview. And in all the literature(cobol) I have gone thru. I see that we must use the 'USING' phrase in Procedure division. Please clear this.. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I was asked this question in an interview. And in all the literature(cobol) I have gone thru. I see that we must use the 'USING' phrase in Procedure division. Please clear this..
|
CEE3PRM?
this is why these forums are so interesting. you give the man the answer and he keeps his head in the sand, ignores the answer and blindly moves forward.
actually, I don't think the OP understands enough to 'understand' the answer. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi,
Quote: |
Are you sure you can code the above statements. I mean without 'USING' phrase in PROCEDURE DIVISION. Please let me know if you have tried it and didnt get any compilation errors. |
HELLO,
If u code with out USING class in Procedure division and in during CALLING program then, What is the use of SUBPROGRAM, But still if u did write with out USING class you wouldn't get any compilation error.
You can do neglect USING phrase in some scenario, for ex: MAIN PROGRAM calling SUBPROGRAMS to GENERATE distinct reports, provided you are not using any variable value from MAIN PROGRAM in SUBPROGRAM.
If u used LINKAGE SECTION and some variables to connect SUBPROGRAM, during, running a program u come across ABEND like SOC1
I think this wil helps you............... |
|
Back to top |
|
|
nasser_tice
New User
Joined: 28 Nov 2006 Posts: 19 Location: India
|
|
|
|
Hi Vasanth,
Thanks.
Now I am clear that we can use in called program say for report generations. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Now I am clear that we can use in called program say for report generations. |
Unfortunately, you are not clear. . .
Yes, this technique can be used to call a module that generates a report, but can be used for many other processes as well.
If you are really interested in this, i'd suggest you re-read all of the replies and learn about EXTERNAL. It has been around for quite a while. . . |
|
Back to top |
|
|
|