Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us