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
 

 

PL\1 compilation error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: PL\1 compilation error
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: 788
Location: Chennai, India

PostPosted: Tue Mar 25, 2008 4:10 pm    Post subject:
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    Post subject: Reply to: PL\1 compilation error
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Wed Mar 26, 2008 10:59 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


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