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
 

 

communicating subprogram without 'USING' in PROCEDURE DIV

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: communicating subprogram without 'USING' in PROCEDURE DIV
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: 785
Location: Chennai, India

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

Please try this.
http://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    Post subject:
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    Post subject:
Reply with quote

here

http://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    Post subject: The link you've provided is not related to my answer.
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    Post subject:
Reply with quote

AGAIN

acevedo wrote:
here

http://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    Post subject:
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Mar 29, 2008 12:33 am    Post subject: communicating subprogram without 'USING' in PROCEDURE DIV
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

Active Member


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

PostPosted: Sat Mar 29, 2008 1:29 am    Post subject:
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    Post subject:
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    Post subject: Are you sure..?
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    Post subject:
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: 276
Location: Bang,iflex

PostPosted: Tue Apr 08, 2008 5:24 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Apr 08, 2008 8:41 pm    Post subject:
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    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 Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm
This topic is locked: you cannot edit posts or make replies. Stored procedure on Federated thru DB2 arif677 DB2 6 Tue May 31, 2016 11:48 pm
No new posts Mainframe COBOL - DB2 Stored Procedure Elixir DB2 2 Sat Mar 19, 2016 9:39 am


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