IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

PL/1 Passing internalProcedure variable to another procedure


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

New User


Joined: 08 Aug 2005
Posts: 15

PostPosted: Tue Oct 14, 2014 6:40 pm
Reply with quote

Hi,
Is it possible to pass a variable declared inside a procedure to another procedure.

PROC1: PROCEDURE;
DCL A CHAR(20);
A = 'ABC';
CALL PROC2;
END PROC1;

PROC2: PROCEDURE;

PUT SKIP LIST('Value from PROC1' !! A);

END PROC2;

Now I get a compiler warning that A is implicitly declared.

Kindly help.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1230
Location: Vilnius, Lithuania

PostPosted: Tue Oct 14, 2014 7:03 pm
Reply with quote

Why do you think it's called an internal variable?

If you want to pass it around, you'll have to use

Code:
PROC1: PROC;
DCL A CHAR(20);
A = 'ABC';
CALL PROC2(a);
END PROC1;

PROC2: PROC(b);
dcl b char(*);

PUT SKIP LIST('Value from PROC1' !! b);

END PROC2;
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Unable to display comp variable COBOL Programming 4
No new posts IWS/TWS build dinamic or variable APp... IBM Tools 0
No new posts Determine what library member is in, ... JCL & VSAM 9
No new posts In JCL Procedure how we can execute R... CLIST & REXX 7
No new posts COBOL - Array result in single variab... COBOL Programming 3

Back to Top