MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unable to execute a REXX EXEC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Thu Jun 01, 2006 6:16 am    Post subject: Unable to execute a REXX EXEC Reply with quote

Hai All,

I am trying to execute a REXX EXEC in different ways and i am successful in three ways only and failing in some ways and my code looks below:
Code:

/* SAMPLE REXX PROGRAM TO FIND THE SUM OF TWO NUMBERS */
SAY 'ENTER THE FIRST NUMBER'                             
PULL NUMBER1                                             
SAY 'ENTER THE SECOND NUMBER'                           
PULL NUMBER2                                             
SUM = NUMBER1 + NUMBER2                                 
SAY 'THE SUM OF TWO NUMBERS IS ' SUM                     

Trying to execute by the following ways:

1.By giving EX on the side of a member in a PDS is Successful
2.TSO EXEC 'USER1.PRIVATE.EXEC(SOMENAME)' 'parm1 parm2' is Successful by running in START 6 option.
3.On the command line in ISPF by giving TSO EXEC 'USER1.PRIVATE.EXEC(SOMENAME)' is Successful .
4.I am trying to invoke Rexx exec in batch by running TSO in batch.
Code:

//RUNEXEC  EXEC PGM=IKJEFT01
//SYSEXEC  DD DISP=SHR,DSN=USER1.PRIVATE.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
%SOMENAME parm1 parm2
/*

Not Successful OUTPUT
Code:

ENTER THE FIRST NUMBER                                     
ENTER THE SECOND NUMBER                                     
     6 +++ SUM = NUMBER1 + NUMBER2                         
IRX0041I Error running SOMENAME, line 6: Bad arithmetic conversion

5.Trying through this way:
Code:

//RUNEXEC  EXEC PGM=IKJEFT01,
//          PARM=' %SOMENAME parm1 parm2'
//SYSEXEC  DD DISP=SHR,DSN=USER1.PRIVATE.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY

Not Successful OUTPUT
Code:

ENTER THE FIRST NUMBER                                     
ENTER THE SECOND NUMBER                                     
     6 +++ SUM = NUMBER1 + NUMBER2                         
IRX0041I Error running SOMENAME, line 6: Bad arithmetic conversion

Please help me out as how can i execute my EXEC properly and are there any more ways to execute a REXX EXEC as i am knew to REXX ?
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Thu Jun 01, 2006 7:19 am    Post subject: Reply with quote

Look into parse arg and question if the args are given or not.
parse arg number1 number2
if number1 = '' then do
say "Enter the first number"
pull number1
end
if..
Back to top
View user's profile Send private message Visit poster's website
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu Jun 01, 2006 10:30 am    Post subject: Reply with quote

Add a TRACE I as second statement and review what you see when you execute to help with understanding.
Back to top
View user's profile Send private message
arnold57
Beginner


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Thu Jun 01, 2006 6:22 pm    Post subject: Reply with quote

You are executing it properly, you're just not providing the input properly. You must provide the lines to be PULL'd in the SYSTSIN file.

Code:
//RUNEXEC  EXEC PGM=IKJEFT01
//SYSEXEC  DD DISP=SHR,DSN=USER1.PRIVATE.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
%SOMENAME
4
5
/*
Back to top
View user's profile Send private message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Fri Jun 02, 2006 1:11 am    Post subject: Reply with quote

Arnold57,

Thanks for your reply and i was able to execute it perfectly.But i am failing once again if i am coding using PARM parameter like below:
Code:
//RUNEXEC  EXEC PGM=IKJEFT01,
//          PARM=' %SOMENAME parm1 parm2'
//SYSEXEC  DD DISP=SHR,DSN=USER1.PRIVATE.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY

Can u help me out to solve the problem ?
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jun 02, 2006 1:37 am    Post subject: Reply with quote

Why do you think that should work? Pull has nothing to do with parameters passed in. Reread Warp5's post.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group