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

PL\1 compilation error


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Tue Mar 25, 2008 2:38 pm
Reply with quote

Hi,

when i try to compile below PL\1 pgm i am getiing compilation error . can any one tell where i went wrong

PL\1 pgm:-

Code:
PRMAIN: PROCEDURE;                           
 DECLARE NAME CHARACTER (20),  ITEM BIT (5), 
 OUTSUB ENTRY;                               
 CALL OUTSUB (NAME, ITEM);                   
END PRMAIN;                                   
OUTSUB:   PROCEDURE (A,B);                   
  DECLARE A CHARACTER (20), B BIT (5);       
  PUT LIST (A,B);                             
END OUTSUB;


compilation error:-

Code:
IEL0241I S           END OF SOURCE TEXT FOUND BEFORE LOGICAL END OF PROGRAM.   1 'END' STATEMENT(S) ASSUMED.   
IEL0413I E   2       DECLARATION OF INTERNAL ENTRY NOT ALLOWED.    DECLARATION OF 'OUTSUB' IGNORED.
IEL0289I S   4       LOGICAL END OF PROGRAM FOUND BEFORE END OF SOURCE TEXT.  STATEMENT IGNORED.
Back to top
View user's profile Send private message
Gnanas N

Active Member


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

PostPosted: Tue Mar 25, 2008 4:10 pm
Reply with quote

Is this okay?
Code:
PRMAIN:PROCEDURE(MAIN);                 
  DCL NAME1 CHAR(20) INIT('NOTHING');   
  DCL ITEM BIT(5) INIT('1'B);           
  CALL OUTSUB(NAME1,ITEM);               
OUTSUB:PROCEDURE(A,B);                   
  DCL A CHAR(20);                       
  DCL B BIT(5);                         
  PUT LIST (A,B);                       
END; /* END OF OUTSUB */                 
END; /* END OF PRMAIN */                 


I have compiled this on IBM PL/I for MVS & VM, Ver 1 Rel 1 Mod 1
Can you understand what was the problem?
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Tue Mar 25, 2008 5:44 pm
Reply with quote

Another solution of your problem.

Compile MAIN procedure separetly from OUTSUB.
Code:
PRMAIN: PROCEDURE OPTIONS(MAIN);                                 
 DECLARE NAME CHAR(20) INIT('HELLO') , ITEM BIT(5) INIT('00001'B);
 DCL OUTSUB ENTRY (CHAR(20),BIT(5));                             
 CALL OUTSUB (NAME, ITEM);                                       
END ;                                                             



You can make this OUTSUB as seperate source code and compile it.
sothat it can be reusable.
Code:
 OUTSUB:   PROCEDURE (A,B);             
   DECLARE A CHARACTER (20), B BIT (5); 
   PUT LIST (A,B);                       
 END OUTSUB;             
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Wed Mar 26, 2008 10:17 am
Reply with quote

Hi gnanas,

This PL/1 pgm is example for an external subroutine as name depicts subroutine “OUTSUB” should be outside the main PL/1 pgm.

Thanks,
Back to top
View user's profile Send private message
Gnanas N

Active Member


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

PostPosted: Wed Mar 26, 2008 10:59 am
Reply with quote

Yes, External procedures are compiled separately from the invoking procedures as Arivazhagan has showed.
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top