Mainframe Utility: ECSR

Return to Mainframe Utilities Page

Module


ISREDIT MACRO
/*  CONTROL MSG LIST CONLIST SYMLIST NOFLUSH NOPROMPT
    CONTROL NOMSG NOLIST NOFLUSH NOPROMPT
/*  THIS EDIT MACRO WILL TAKE YOU TO ISPF EDIT ON A DATASET */
/*  THAT EXISTS ON THE CURRENT CURSOR LINE */
/*  PUT YOUR CURSOR ON A LINE WITH A DSN= AND OFF TO ISPF EDIT YOU GO */
ISREDIT (LPTR,CPTR) = CURSOR
ISREDIT (CLINE) = LINE &LPTR
CONTROL NOFLUSH
SET &BEGDSN = &SYSINDEX(DSN,&STR(&CLINE)) + 4
IF &BEGDSN EQ 4 THEN -
  DO
    SET ZEDLMSG = &STR(***NO DSN EXISTS ON THIS LINE***)
    ISPEXEC SETMSG MSG(ISRZ001)
    GOTO ENDTAG
  END
ELSE -
  DO
    SET &ENDDSN = &SYSINDEX(&STR(,),&STR(&CLINE),&BEGDSN)
    SET &DSN = &SUBSTR(&BEGDSN:&ENDDSN-1,&CLINE)
    SELECT
      WHEN (&SYSDSN('&DSN')=OK) -
      DO
        LISTDSI '&DSN'
        IF &LASTCC = 0 THEN -
          DO
            ISPEXEC EDIT DATASET('&DSN')
          END
        ELSE -
          GOTO ERRORTAG
      END
      WHEN (&SYSDSN('&DSN')=&STR(UNAVAILABLE DATASET))-
      DO
         LISTDSI '&DSN'
         IF &LASTCC = 0 THEN -
           DO
              SET ZEDLMSG = &STR(&SYSDSN('DSN')
              ISPEXEC SETMSG MSG(ISRZ001)
              ISPEXEC BROWSE DATASET('DSN')
           END
      END
      OTHERWISE -
         GOTO ERRORTAG
    END
    GOTO ENDTAG
ERRORTAG: -
    SET ZEDLMSG = &STR(***ERROR: &SYSDSN('DSN')***)
    ISPEXEC SETMSG MSG(ISRZ001)
    GOTO ENDTAG
END
ENDTAG: -
END
            


Documentation


 ECSR - This edit macro command will transfer the edit session to ISPF EDIT the
 dataset listed in the DSN parameter of the DD statement of JCL.  The cursor
 must be on the line of the DSN parameter of the JCL.  To return to the edit
 session of the JCL, hit the PF3 key.
            


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.