Hi

/* factorialProgram.rex -- computes the factorial of a number */

/* Usage: exec factorialProgram number */

/* Example: exec factorialProgram 5 */

arg N .

call factorial N

say result

exit 0 /* don't fall through to the PROCEDURE instruction */

/* internal procedure FACTORIAL

* returns factorial of argument N

*/

factorial : PROCEDURE

n = arg( 1 )

if n = 1 then

return 1

return n * factorial( n - 1 )

i have given in my pds member and execcuted using the command in the ispf panel " tso exec rexx.exec(main1) exec"

rexx.exec(main1) is the dataset where i have stored the above rexx code

please help me on how to execute this

if i try this it is showing error in the line exit 0