View previous topic :: View next topic |
Author |
Message |
mfuser Banned
Joined: 01 Mar 2005 Posts: 105 Topics: 58
|
Posted: Thu Jun 01, 2006 6:16 am Post subject: Unable to execute a REXX EXEC |
|
|
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 |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Jun 01, 2006 7:19 am Post subject: |
|
|
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 |
|
 |
taltyman JCL Forum Moderator

Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Thu Jun 01, 2006 10:30 am Post subject: |
|
|
Add a TRACE I as second statement and review what you see when you execute to help with understanding. |
|
Back to top |
|
 |
arnold57 Beginner
Joined: 01 Oct 2004 Posts: 30 Topics: 0
|
Posted: Thu Jun 01, 2006 6:22 pm Post subject: |
|
|
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 |
|
 |
mfuser Banned
Joined: 01 Mar 2005 Posts: 105 Topics: 58
|
Posted: Fri Jun 02, 2006 1:11 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Jun 02, 2006 1:37 am Post subject: |
|
|
Why do you think that should work? Pull has nothing to do with parameters passed in. Reread Warp5's post. |
|
Back to top |
|
 |
|
|