Mainframe Utility: DISVAR

Return to Mainframe Utilities Page

Module


/**********************************************************************
/* UTILITY: DISVAR                                                    *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: DISPLAY A VARIABLE VALUE WHICH IS IN AN ISPF VARIABLE    *
/*           POOL.  THE PROFILE POOL CAN BE CHANGED BY SPECIFYING THE *
/*           PROFILE TO LOOK AT IN THE "PROFILE" KEYWORD VARIABLE.    *
/*           YOU CAN CALL DISVAR FROM ANOTHER PROCESS AND HAVE THE    *
/*           VALUE RETURED IN THE ISPF SHARED VARIABLE "DISVARVL" BY  *
/*           SPECIFYING "BATCH".                                      *
/**********************************************************************
PROC 1 VAR PROFILE() OLDAPPL() BATCH
/**** SET MESSAGE DISPLAY ON/OFF BASED ON THE DEBUG SWITCH ***/
ISPEXEC VGET (DBGSWTCH) PROFILE
IF &DBGSWTCH = &STR(ON) THEN CONTROL MSG LIST CONLIST SYMLIST NOFLUSH
ELSE CONTROL NOMSG NOLIST NOFLUSH NOPROMPT

IF &STR(&VAR) = &STR(HELP) THEN GOTO HELPSEC

IF &STR(&PROFILE) >   THEN +
    DO
        ISPEXEC VGET ZAPPLID SHARED
        ISPEXEC SELECT CMD(%DISVAR &VAR &BATCH OLDAPPL(&ZAPPLID)) +
                       NEWAPPL(&PROFILE)
        ISPEXEC VGET DISVARVL PROFILE
        ISPEXEC VPUT DISVARVL SHARED
        SET DISVARVL =
        ISPEXEC VPUT DISVARVL PROFILE
        EXIT
    END

ISPEXEC VGET (&VAR)
SET VALUE = &STR(&&)&STR(&VAR)

IF &BATCH = BATCH THEN +
    DO
        SET DISVARVL = &STR(&VALUE)
        IF &STR(&OLDAPPL) >   THEN +
            ISPEXEC SELECT CMD(%PROFUPDT &OLDAPPL VARIABLE(DISVARVL) +
                           VALUE(&DISVARVL))
        ELSE +
            ISPEXEC VPUT DISVARVL SHARED
        EXIT
    END

SET ZEDLMSG = &STR(&VAR = &VALUE)

IF &LENGTH(&STR(&ZEDLMSG)) > 78 AND +
   &SYSINDEX(&STR(ISPF 2.3),&STR(&ZENVIR)) > 0 THEN +
    DO
        SET ZEDLMSG = &SUBSTR(1:78,&STR(&ZEDLMSG))
        ISPEXEC SETMSG MSG(UTLZ000)
    END
ELSE +
    ISPEXEC SETMSG MSG(UTLZ000W)

EXIT

HELPSEC: +                                                              02480000
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)                             02490000
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR DISVAR UTILITY +              02490000
                   *** NO PROCESSING PERFORMED ***)                     02490000
ISPEXEC SETMSG MSG(UTLZ000)                                             02490000
EXIT
            


Documentation

 This utility does an "ISPEXEC VGET (xxxxxxxx) ASIS" where 'xxxxxxxx' is the
 variable named passed at invocation time, and returns the value of that
 variable in an ISPF message display.
 
 Example :
 
 Command ===> TSO DISVAR ZTIME      <=== this would display the following line
 ZTIME = 19:36            


Leave a Reply

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