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
 

 

How to call other REXX pgm from the main REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:10 pm    Post subject: How to call other REXX pgm from the main REXX
Reply with quote

Hi,


I have a mail REXX pgm (PGM1) and i need to call another REXX pgm (PGM2) from that PGM1.

I have to call another pgm named PGM3 from PGM1 by passsing some parameter which ll be used by the PGM3.

Can anyone please help me how to achieve the above ones.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 08, 2010 3:19 pm    Post subject:
Reply with quote

Have you read about the CALL function ?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 08, 2010 3:24 pm    Post subject: Reply to: How to call other REXX pgm from the main REXX
Reply with quote

Directly by name usually works best:

Code:

/* REXX PGM1 */
Say PGM1
PGM2
Say PGM1
parm = '1 2 3 4'
PGM3 parm
Say PGM1
Exit 0


Code:

/* REXX PGM2 */
Say PGM2
Exit 0


Code:

/* REXX PGM3 */
Say PGM3 Arg(1) Arg(2) Arg(3) Arg(4)
Exit 0
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:28 pm    Post subject:
Reply with quote

Hi Kelvin,

Thaks for the help. I ll try this .

@ Expat

Thanks for the hint. As i am new to REXX programming so unaware of these terms. Surely i ll check it out and try to implement the same.
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:34 pm    Post subject:
Reply with quote

Hi ...

I just need one more hint regarding validating a string.

I am having a variable names Var1. I need to check if the first 3 characters are either AAA or BBB or CCC then i ll procced further.

I have used like below,

Code:


Var2 = Substr(VAR1,1,3)
Var2 = AAA | BBB | CCC
If Var2 = 1 then do
----
---
---
end



I dont know whether i was doing correct or not... But i am not getting my value.

Can any1 help me out to achieve this.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 08, 2010 3:52 pm    Post subject: Reply to: How to call other REXX pgm from the main REXX
Reply with quote

You COULD code

If Left(var1,3) = 'AAA' | Left(var1,3) = 'BBB' | Left(var1,3) = 'CCC' Then ...
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Thu Apr 08, 2010 4:54 pm    Post subject:
Reply with quote

Thanks For the help Kelvin.

It works fine for me.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 08, 2010 5:20 pm    Post subject:
Reply with quote

siva102 wrote:
Thanks For the help Kelvin.
It works fine for me.

Who is Kelvin
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Thu Apr 08, 2010 5:21 pm    Post subject:
Reply with quote

The temperature Lord? icon_smile.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 08, 2010 5:31 pm    Post subject: Reply to: How to call other REXX pgm from the main REXX
Reply with quote

Believe me, I've been called worse ... icon_rolleyes.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Apr 08, 2010 5:49 pm    Post subject: Re: Reply to: How to call other REXX pgm from the main REXX
Reply with quote

superk wrote:
Believe me, I've been called worse ...
mm..that's an easy name to pronounce, for me too, even being from a non-english back-ground...what you have been called, I wonder.

On the other hand, when I was in Phoenix, it was fun to listen different sounds made for my name too. One lady called me "Ad" and that's it; for a long time I used to think it was not me who she is calling up! icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 08, 2010 6:27 pm    Post subject:
Reply with quote

Anuj wrote:
for a long time I used to think it was not me who she is calling up!
No Comment icon_lol.gif

Robert wrote:
The temperature Lord?
Minus 273 - sounds about right for my physics test scores icon_lol.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Apr 08, 2010 9:23 pm    Post subject: Re: Reply to: How to call other REXX pgm from the main REXX
Reply with quote

superk wrote:
Believe me, I've been called worse ... icon_rolleyes.gif
Try to live with a name like "Martial".

My friends used to call me "Martial Marso" because it sounds almost like "Marcel Marceau", the famous pantomime.
And this is how I got my favorite nickname!
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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