Mainframe Utility: GDASWTCH

Return to Mainframe Utilities Page

Module


/**********************************************************************
/* UTILITY: GDASWTCH                                                  *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: THIS CLIST RENAMES A PERSONAL GDA DATASET (IF IT EXISTS) *
/*           TO A DIFFERENT NAME.  IF IT FINDS THE "DIFFERENT" NAME   *
/*           IT RENAMES IT TO THE APPROPRIATE NAME FOR GDA TO FIND IT.*
/**********************************************************************
PROC 0 DEBUG NOEXEC GDANAME(&STR(ISPF.ISPPROF(GDAPRM01))) +
                    RENAME(&STR(ISPF.ISPPROF(GDXPRM01))) +
                    HELP
IF &DEBUG = DEBUG THEN +
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH NOPROMPT ASIS
ELSE +
    CONTROL NOMSG NOLIST NOFLUSH NOPROMPT ASIS

/**********************************************************************
/* DISPLAY HELP IF REQUESTED                                          *
/**********************************************************************
IF &HELP = HELP THEN GOTO HELPSEC

IF &SYSDSN('&STR(&SYSUID..&GDANAME)') = &STR(OK) THEN +
    DO
        RENAME '&SYSUID..&GDANAME' '&SYSUID..&RENAME'
        WRITE &STR(*** SYSTEM DEFAULT GDA IN EFFECT NOW ***)
        IF &NOEXEC = NOEXEC THEN +
            EXIT
        ELSE +
            GDA *
        EXIT
    END

IF &SYSDSN('&STR(&SYSUID..&RENAME)') = &STR(OK) THEN +
    DO
        RENAME '&SYSUID..&RENAME' '&SYSUID..&GDANAME'
        WRITE &STR(*** PERSONAL GDA IN EFFECT NOW ***)
        IF &NOEXEC = NOEXEC THEN +
            EXIT
        ELSE +
            GDA *
        EXIT
    END

WRITE &STR(NO PERSONAL, OR RENAMED GDA FILES FOUND TO SWITCH)
EXIT

/**********************************************************************
/* DISPLAY ANY "HELP" WHICH IS AVAILABLE FOR THIS UTILITY             *
/**********************************************************************
HELPSEC: +
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR GDASWTCH UTILITY +
                   *** NO PROCESSING PERFORMED ***)
ISPEXEC SETMSG MSG(UTLZ000)
EXIT
            


Documentation


 GDASWTCH is a CLIST which permits you to toggle back and forth between the
 system default GDA control file and your personal GDA control file if you have
 one.  It does this by renaming your GDA control file so that the system does
 not find it to execute, and renaming it back so that the system does find it to
 execute.  It's a "toggle" type of execution so that it takes the current
 situation and just reverses it.

 So, if you have a GDA control file and you are at the READY prompt (where
 GDASWTCH must be executed), you simply type GDASWTCH and press  (don't
 type "tso" in front of it).  GDASWTCH renames your control file from
 userid.GDA.DATA to userid.GDA.DATA.RENAMED, sends you a message to let you know
 that the "system default" GDA control file ('SYS2.GDA.CNTL(GDATA)') is now
 being used.

 If you then get back out to the READY prompt and type GDASWTCH again, it
 renames the file back from userid.GDA.DATA.RENAMED to userid.GDA.DATA, sends
 you a message to let you know that your personal GDA is now in effect and
 invokes GDA.

 If you just want to do the rename, but you don't want to re-invoke GDA
 processing, you type GDASWTCH NOEXEC.  GDASWTCH does the naming and sends you
 the message and just exits.

 If GDASWTCH cannot find a dataset named userid.GDA.DATA or
 userid.GDA.DATA.RENAMED, it sends a message to that effect and just quits.
            


Leave a Reply

Your email address will not be published. Required fields are marked *