View previous topic :: View next topic
|
Author |
Message |
arnab3472
New User
Joined: 28 Feb 2007 Posts: 1 Location: United States
|
|
|
|
I am new in REXX. I wrote a simple edit macro but enable to execute the editmaro statements.
Code: |
/*REXX*/
SAY 'HELLO'
TRACE R
ADDRESS ISPEXEC
"ISREDIT MACRO () NOPROCESS"
"ISREDIT RESET EXCLUDED"
"ISREDIT EXCLUDE ALL '-' 1"
"ISREDIT FIND FIRST '-' 1"
"ISREDIT DELETE ALL EXCLUDED"
EXIT |
The 'HELLO' is being displayed but after ADDRESS ISPEXEC statement, all the statements are giving rc 20.
Can anybody help me to correct the code? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
The 'HELLO' is being displayed because what you have coded is a REXX exec, not an edit MACRO. The rc=20 is happening for the other lines because REXX does not understand them.
In your REXX, you need to invoke edit for a dataset e.g.
Code: |
ADDRESS ISPEXEC "EDIT DATASET('"dsn"")') MACRO("macname ")" |
and have the MACRO coded separately in a library available to the REXX exec e.g.
Code: |
ADDRESS ISPEXEC
"ISREDIT MACRO () NOPROCESS"
"ISREDIT RESET EXCLUDED"
"ISREDIT EXCLUDE ALL '-' 1"
"ISREDIT FIND FIRST '-' 1"
"ISREDIT DELETE ALL EXCLUDED"
"ISREDIT SAVE" |
Garry. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
Michael Jakob
New User
Joined: 13 Mar 2011 Posts: 17 Location: Switzerland
|
|
|
|
Hello arnab3472
Runs your edit macro in a proper edit session? How did you call your edit-macro? "COMMAND ===> TSO hello" will not work.
Is there any reason you need noprocess?
I rather would specify "ISREDIT MACRO " without parenthesis and noprocess.
An edit-macro should be ended by "ISREDIT MEND"
At last an edit-macro should return an reasonable returncode. (EXIT)
0: all fine - cursor stayes at last position.
1: fine - but the cursor is placed at the command field.
other: signal an problem in edit macro.
The manual "ISPF Edit and Edit Macros" mentioned above is a fine and usable manual. |
|
Back to top |
|
|
|