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

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: 1306
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Passing SYSPRINT to Invoked Program PL/I & Assembler 9
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top