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

is this code correct??


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

New User


Joined: 15 Jul 2005
Posts: 1

PostPosted: Tue Aug 02, 2005 2:31 pm
Reply with quote

hi

cud u pls explain how the call works in this case and also tell me the o/p

test: procedure options(main);

declare a fixed bin(31);

a = 100;
call subroutine(a,100);
put skip list (a,100);

end test;

subroutine: procedure(x,y);
declare (x,y) fixed bin(31);

x = 101;
y = 101;

end subroutine;


thanks
roshan
Back to top
View user's profile Send private message
bakarthikeyan

New User


Joined: 21 Sep 2005
Posts: 6

PostPosted: Wed Sep 21, 2005 11:59 pm
Reply with quote

No. you have to use DCL <EXTERNAL PROC NAME> EXTERAL; in the calling program. So that, u can combine both.
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Thu Sep 22, 2005 6:50 pm
Reply with quote

Yep, external proc name must be declared.
The output will be 101 and 100.
Do correct me for any mistakes.
Thanks!
Sridevi.
Back to top
View user's profile Send private message
jawadshaik
Warnings : 1

New User


Joined: 27 Sep 2005
Posts: 16

PostPosted: Wed Oct 19, 2005 7:32 pm
Reply with quote

proc1: proc options(main);

dcl x bin fixed(15) init(10);

dcl sub_proc entry(fixed bin(15) , fixed bin(15));

put skip list(x,a);

end proc1;

sub_proc: proc(x,y);

dcl (x,y) fixed bin(15);

x = x + 1;

y = y + 1;

end sub_proc;



output:

101

100



hope this will be clear

regards,

jawad shaik
Back to top
View user's profile Send private message
jawadshaik
Warnings : 1

New User


Joined: 27 Sep 2005
Posts: 16

PostPosted: Wed Oct 19, 2005 7:38 pm
Reply with quote

SORRY FRIEND

CALL SUB_PROC(X,100); IS MISSED AFTER

SO


dcl sub_proc entry(fixed bin(15) , fixed bin(15));

call sub_proc(x,100);

put skip list(x,100);


AND OUTPUT IS

11

100



sorry for mistake plz dont mind
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Wed Oct 19, 2005 8:28 pm
Reply with quote

Hi jawadshaik,
Roshan wants to know the output for HIS code. YOUR code is different,fine. Even after considering your 2nd post, I couldn't predict what you are trying to convey. In your 1st code,X is initialized to 10 but the output is 101 and 100.What is variable "a"? Your 2nd code's output is 11 and 100. Please be clear on what you would like to convey.
Regards,
Sridevi.
Back to top
View user's profile Send private message
jawadshaik
Warnings : 1

New User


Joined: 27 Sep 2005
Posts: 16

PostPosted: Thu Oct 20, 2005 12:20 pm
Reply with quote

Hi,

Sorry For Confusing


Here is what I meant


PROC1: PROC OPTIONS(MAIN);

DCL X FIXED BIN(15) STATIC INIT(100);

DCL SUB_PROC ENTRY(FIXED BIN(15),FIXED BIN(15));

CALL SUB_PROC(X,100);

PUT SKIP LIST(X,100);

END PROC1;


SUB_PROC: PROC(Y,Z);

DCL (Y,Z) FIXED BIN(15);

Y = Y + 1;

Z = Z + 1;

END SUB_PROC;



OUTPUT:

101 100


Hope I am clear know

regards,

Jawad shaik
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top