Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

is this code correct??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: is this code correct??
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    Post subject: Re: is this code correct??
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    Post subject:
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    Post subject: Re: is this code correct??
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    Post subject: SORRY CALL STATEMENT MISSING
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    Post subject:
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    Post subject: Reply
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the explanation correct? XRST,CHKP Martylin IMS DB/DC 1 Wed Mar 15, 2017 9:26 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us