MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PLI Subroutine

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Mon Jan 28, 2008 11:21 am    Post subject: PLI Subroutine Reply with quote

Hai,

[code:1:b5ee1d0b5f]
MAINPROC:PROCEDURE OPTIONS(MAIN);
DCL X FIXED DEC(7,2);
DCL Y FIXED DEC(7,2);
DCL Z FIXED DEC(8,2);
DCL SUBRT ENTRY;
/*declares SUBRT as procedure */
GET LIST(X,Y);
CALL SUBRT(X,Y,Z);
PUT LIST(
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12383
Topics: 75
Location: San Jose

PostPosted: Mon Jan 28, 2008 12:10 pm    Post subject: Reply with quote

Quote:
For example in COBOL we write a sub program ,compile it and then compile the main program which is calling it and then run the main program .In PLI how is this possible , can anybody plz help me as i am not clear.


yadav2005,

what makes you think you have to compile subprograms separately? Cobol can have nested programs within a main program. Check this link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg10/4.1.3.6.1?SHELF=&DT=20020923143836&CASE=

Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Mon Jan 28, 2008 12:20 pm    Post subject: Reply with quote

Kolusu,

Thank You for your reply.Can you please tell me the equivalent of COBOL in PLI as below and how we can execute this:
Code:

MAIN PROGRAM

CALL 'ABC' USING X,Y.
        STOP RUN.


Code:

SUB PROGRAM

PROCEDURE DIVISION USING X,Y.

In cobol we compile Sub Program seperately and then comPile main program and run the main program.If a similar kind is needed to be achived ,can it be achieved in PL1 and how. Please let me know from you.
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Jan 29, 2008 1:34 am    Post subject: Reply with quote

yadav2005,

Check the below link.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/C2714602/6.5?DT=20020917160741
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jan 29, 2008 5:08 am    Post subject: Reply with quote

Quote:

what is the difference in External Procedure and Internal Procedure on PLI ?

An external routine is one that is written and compiled separate to the routine calling it. An internal routine is one that is coded within the same program.

You could consider a PERFORMed Cobol paragraph the same as a PL/1 sub-routine except PL/1 sub-routines cannot be fallen through to except by bad coding which the compiler should pick up. They are NOT the same but it might help your understanding.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group