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

How to call other REXX pgm from the main REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
siva102

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:10 pm
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: 8796
Location: Welsh Wales

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

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

Global Moderator


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

PostPosted: Thu Apr 08, 2010 3:24 pm
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: 63
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:28 pm
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: 63
Location: Chennai

PostPosted: Thu Apr 08, 2010 3:34 pm
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

Global Moderator


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

PostPosted: Thu Apr 08, 2010 3:52 pm
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: 63
Location: Chennai

PostPosted: Thu Apr 08, 2010 4:54 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Apr 08, 2010 5:20 pm
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: 8700
Location: Dubuque, Iowa, USA

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

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

Global Moderator


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

PostPosted: Thu Apr 08, 2010 5:31 pm
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

Superior Member


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

PostPosted: Thu Apr 08, 2010 5:49 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Apr 08, 2010 6:27 pm
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: 1353
Location: Israel

PostPosted: Thu Apr 08, 2010 9:23 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
Search our Forums:

Back to Top