Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
roopannamdhari
Warnings : 1

Active User


Joined: 14 Sep 2006
Posts: 53
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
References
Gnanas SNG

Senior Member


Joined: 06 Sep 2007
Posts: 440
Location: 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: 37
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

Active User


Joined: 14 Sep 2006
Posts: 53
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 SNG

Senior Member


Joined: 06 Sep 2007
Posts: 440
Location: 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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1