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

communicating subprogram without 'USING' in PROCEDURE DIV


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Fri Mar 28, 2008 6:42 pm
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Fri Mar 28, 2008 6:57 pm
Reply with quote

Please try this.
publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entcobol4.doc/rlpdsusi.htm
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Mar 28, 2008 6:59 pm
Reply with quote

search for CEE3PRM—Query parameter string
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Mar 28, 2008 7:00 pm
Reply with quote

here

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.ceea300/clcprm.htm

;)
Back to top
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Fri Mar 28, 2008 7:06 pm
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Mar 28, 2008 7:09 pm
Reply with quote

AGAIN

acevedo wrote:
here

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.ceea300/clcprm.htm

;)
Back to top
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Fri Mar 28, 2008 7:15 pm
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Mar 28, 2008 7:18 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Mar 29, 2008 12:33 am
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1035
Location: Richmond, Virginia

PostPosted: Sat Mar 29, 2008 1:29 am
Reply with quote

nasser -

Why do you want to do this?
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Sat Mar 29, 2008 3:31 pm
Reply with quote

Yes. You can code
Code:
PROCEDURE DIVISION
instead of
Code:
PROCEDURE DIVISION USING VARIABLES

Use the
Code:
LINKAGE SECTION
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
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Tue Apr 08, 2008 2:44 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 08, 2008 3:20 pm
Reply with quote

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
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Tue Apr 08, 2008 5:24 pm
Reply with quote

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............... icon_lol.gif
Back to top
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Tue Apr 08, 2008 6:20 pm
Reply with quote

Hi Vasanth,

Thanks.

Now I am clear that we can use in called program say for report generations.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 08, 2008 8:41 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Parallel Sysplex - subprogram execution CICS 7
Search our Forums:

Back to Top