View previous topic :: View next topic
|
Author |
Message |
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
hi all,
i have just started studying REXX. while creating macros for the opening of copy books or the dataset mentioned in the jcl, i had a problem. while i tried to open the jcl with imacro, the macro starts running and get failed. i want my macro to run only when the enter key is pressed. can anyone help me on this case. |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
hi this is the macro program i have written for that
Code: |
/* REXX */
"MACRO"
ADDRESS ISREDIT
X = MSG('OFF')
"(NUM) = LINENUM ".ZCSR
"(LNCONT) = LINE "NUM
IND = INDEX(LNCONT,"'")
DSN = SUBSTR(LNCONT,IND+1)
DSN = STRIP(STRIP(DSN),B,"'")
DSN = "'"||DSN||"'"
SAY DSN
IF SYSDSN(""DSN"")= 'OK' THEN
DO
ADDRESS ISPEXEC
"VIEW DATASET("DSN") MACRO(RES)"
END
EXIT
|
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I would call the ISPF EDIT session with a panel:
Do Forever
"ISPEXEC EDIT DATASET('dsname') PANEL(thepanel)"
If rc <> 0 Then Exit
Else (call EDIT with the macro)...
End
With a panel, you can process the Return-code based on Enter (rc=0) or End (rc=8). When rc=0, then call EDIT again, this time without the panel, but with the macro. |
|
Back to top |
|
|
|