View previous topic :: View next topic
|
Author |
Message |
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Hi!
I'm trying to run edit macros in ISPF batch and receive RC=20 on any command right after Address ISREDIT.
This is macro:
/*REXX*/
X = LISTDSI(FILE01 FILE)
trace ?I
IF X = 0 THEN
DO
Address ISREDIT
"MACRO"
"EDIT DATASET('"SYSDSNAME"')"
"X 'SOURCE' ALL"
"delete NX ALL"
"SAVE"
"END"
end
else
say 'File name invalid'
exit
This is displays on SDSF:
READY
PROFILE PREFIX(RMD0142)
READY
ISPSTART CMD(%TEMP) NEWAPPL(ISR)
4 *-* IF X = 0
>V> "0"
>L> "0"
>O> "1"
IRX0100I +++ Interactive trace. TRACE OFF
*-* THEN
5 *-* DO
6 *-* Address ISREDIT
7 *-* "MACRO PROCESS"
>L> "MACRO PROCESS"
+++ RC(20) +++
8 *-* If rc = 0
>V> "20"
>L> "0"
Any command after receives same RC=20.
What I'm doing wrong? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I believe that the EDIT command is properly addressed to ISPF, not the Edit service itself,and would therefore be coded as:
Code: |
address ispexec "EDIT DATASET('" || sysdsname || "') MACRO(macro_name)"
|
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm confused.
If the dataset exists (checked by the LISTDSI function), then you call an ISPF Edit Service, but you haven't shown where you pass it the name of the ISPF Edit Macro. |
|
Back to top |
|
|
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Superk,
This is probably where one of my problems is. I was under impression that once I issue "EDIT DATASET('"SYSDSNAME"')" command the rest of commands (Find, exclude....) will be issued against this dataset. But why I received RC=20 on MACRO? This is before I issue EDIT command. |
|
Back to top |
|
|
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Akatsukami,
you were right, once I change my code per your instruction it works!
Thank you. |
|
Back to top |
|
|
|