I am trying to use MACRO for easy DNAME execution. while submitting the macro I have below.
* Command in error . : MACRO(VIEW) *
* *
* Command not executed *
* An ISREDIT MACRO statement must precede any executable statements. *
* *
* Error message ID . : ISRE741 *
* *
* Last return code . : 28 *
* *
* Macro executing . : SRTOL *
* *
* Press ENTER key to terminate the macro. *
* *
* *
* Command not executed *
* An ISREDIT MACRO statement must precede any executable statements. *
* *
* Error message ID . : ISRE741 *
* *
* Last return code . : 28 *
* *
* Macro executing . : SRTOL *
* *
* Press ENTER key to terminate the macro. *
* *
I checked on IBM Knowledge center and the issue explanation state
The macro name you entered does not have the ISREDIT MACRO statement as the first executable instruction
I checked my program.
/* REXX */
ADDRESS ISREDIT
"MACRO(VIEW)"
"(CURL,CURC) = CURSOR"
"(LINEDATA) = LINE" CURL
PARSE VAR LINEDATA BEQUAL '=' DSNAME ','
IF SYSDSN("'"DSNAME"'") = 'OK' THEN
DO
SELECT
WHEN VIEW = 'E' THEN
DO
ADDRESS ISPEXEC "EDIT DATASET('"DSNAME"')"
END
WHEN VIEW = 'V' THEN
DO
ADDRESS ISPEXEC "VIEW DATASET('"DSNAME"')"
END
WHEN VIEW = 'B' THEN
DO
ADDRESS ISPEXEC "BROWSE DATASET('"DSNAME"')"
END
WHEN VIEW = 'D' THEN
DO
ADDRESS TSO "DELETE '"DSNAME"'"
END
OTHERWISE
DO
SAY 'PLEASE SELECT APPRPIATE OPTION'
END
END
END
ELSE
DO
SAY 'DATSET IS NOT FOUND'
END
ADDRESS ISREDIT
"MACRO(VIEW)"
"(CURL,CURC) = CURSOR"
"(LINEDATA) = LINE" CURL
PARSE VAR LINEDATA BEQUAL '=' DSNAME ','
IF SYSDSN("'"DSNAME"'") = 'OK' THEN
DO
SELECT
WHEN VIEW = 'E' THEN
DO
ADDRESS ISPEXEC "EDIT DATASET('"DSNAME"')"
END
WHEN VIEW = 'V' THEN
DO
ADDRESS ISPEXEC "VIEW DATASET('"DSNAME"')"
END
WHEN VIEW = 'B' THEN
DO
ADDRESS ISPEXEC "BROWSE DATASET('"DSNAME"')"
END
WHEN VIEW = 'D' THEN
DO
ADDRESS TSO "DELETE '"DSNAME"'"
END
OTHERWISE
DO
SAY 'PLEASE SELECT APPRPIATE OPTION'
END
END
END
ELSE
DO
SAY 'DATSET IS NOT FOUND'
END
please advise.