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
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1244
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
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
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
Search our Forums:

Back to Top