Mainframe Utility: SHOWMAP

Return to Mainframe Utilities Page

Oooops!  Disclaimer/Edit 2017-08-08:  This CLIST makes a call to a COBOL program that was written in the shop I was working at back in the day.  I thought the source code for that program was in here.  Unfortunately, I was mistaken.  I’ll keep looking but I’m pretty darn sure that I DON’T have the source code for the program – which renders this utility useless.  Sorry about that.  What the program did was read a CICS BMS macro and then print out a display of what the screen would look like.  The utility intercepted the printout and brought it into the BMS macro edit session is ISPF edit “message” lines so that you could see what the screen would look like.

So, what’s missing is the logic to parse a CICS BMS macro.  This would not be rocket science, but I have no time to develop that, nor do I work with CLIST or Rexx anymore (that dates back about 20 years now – see the disclaimer on the main Mainframe Utilities Page).  This little CLIST just leveraged that hard work from another programmer to see the results on the screen instead of on paper.  Sorry about that!

Module


/**********************************************************************
/* UTILITY: SHOWMAP                                                   *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: THIS EDIT MACRO IS EXECUTED WHILE IN A BMS SOURCE MEMBER *
/*           AND INVOKES DON FAVILLES MAPPRINT PROGRAM IN FOREGROUND  *
/*           TO CREATE A FILE OF THE MAP IMAGE.  THE USER IS THEN     *
/*           TAKEN INTO AN EDIT OF THAT FILE.                         *
/**********************************************************************
ISREDIT MACRO
ISPEXEC CONTROL ERRORS RETURN
/**** 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

/**********************************************************************
/* GET THE MEMBER NAME TO USE FOR MAP AND MAPSET                      *
/**********************************************************************
ISREDIT (MEMBER) = MEMBER
ISREDIT (DATASET) = DATASET

/**********************************************************************
/* CLEAN UP OLD FILES                                                 *
/**********************************************************************
SET MAPFILE = &STR(&SYSUID..TEMP.MAPPRINT.&MEMBER)
DELETE '&MAPFILE'

SET MAPSYS = &STR(&SYSUID..TEMP.MAPPRINT.SYSOUD
DELETE '&MAPSYS'

/**********************************************************************
/* FREE DD'S                                                          *
/**********************************************************************
FREE DD(SYSLST BATCNTL SYSIPT)
FREE DD(SYSOUD PRINTFL MAPFL)

/**********************************************************************
/* ALLOCATE NEW FILES                                                 *
/**********************************************************************
ALLOC DD(SYSOUD) DSN('&MAPSYS') +
                 NEW CATALOG +
                 UNIT(SYSDA) VOLUME(WRK001) +
                 SPACE(1,1) TRACKS RELEASE +
                 RECFM(F B A) LRECL(121) BLKSIZE(23474) DSORG(PS)

ALLOC DD(PRINTFL) DSN('&MAPFILE') +
                  NEW CATALOG +
                  UNIT(SYSDA) VOLUME(WRK001) +
                  SPACE(1,1) TRACKS RELEASE +
                  RECFM(F B A) LRECL(133) BLKSIZE(23408) DSORG(PS)

ALLOC DD(MAPFL) DSN('&DATASET(&MEMBER)') +
                SHR KEEP

/**********************************************************************
/* INVOKE THE PROGRAM                                                 *
/**********************************************************************
/*CALL 'P [at] TLD [dot] SLSS [dot] LOAD(MAPPRINT)' '&MEMBER'
ISPEXEC SELECT PGM(MAPPRINT)
SET PGMCC = &LASTCC

FREE DD(SYSOUD PRINTFL MAPFL)

/**********************************************************************
/* EDIT THE SYSPRINT IF A PROBLEM                                     *
/**********************************************************************
IF &PGMCC ¬= 0 THEN +
    DO
        SET ZEDSMSG = &STR(MAPPRINT PGMCC: "&PGMCC")
        SET ZEDLMSG = &STR(THE "MAPPRINT" PROGRAM GOT A RETURN CODE +
                           OF "&PGMCC")
        ISPEXEC SETMSG MSG(UTLZ001)
        ISPEXEC EDIT DATASET('&MAPSYS')
    END

/**********************************************************************
/* EDIT THE MAP FILE OUTPUT                                           *
/**********************************************************************
SET ZEDLMSG = &STR(TYPE "PRINTIT" AND PRESS  TO PRINT THIS FILE)
ISPEXEC SETMSG MSG(UTLZ000)
ISPEXEC EDIT DATASET('&MAPFILE')
EXIT

Documentation


 SHOWMAP is an ISPF EDIT MACRO which invokes Don Faville's CICS MAPPRINT program
 for the member you are editing and presents you the results on-line.  So, if
 you're editing some BMS source, and you want to know what the map basically
 looks like but you don't want to go to CICS to see that, just type SHOWMAP on
 the command line and press .

 The MAPPRINT program will then operate against the BMS source member you are
 editing, and when finished, will bring you into an edit session of the report
 generated by the program.  You can print this fairly easily at this point by
 typing PRINTIT and pressing .

5 Comments

  1. Hi David,

    I tried copying your code to execute viewing of BMS or seeing the map from source map.I am seeing so many errors .for below example it is showing as invalid expression..

    IF &DBGSWTCH = &STR(ON) THEN +
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH

    Could you please share the rexx code which was already executed and tested.

    Thanks in advance,
    Syed wasim

  2. Hi Syed,
    A couple of things:
    1. This is not a REXX program but a CLIST. I have both on this site (most are CLIST). REXX programs and CLISTs are executed slightly differently and are different programming languages but have very similar usages. *SOME* of the error messages may have to do with that.
    2. More importantly, this CLIST relies on a COBOL program – i.e. it CALLs a COBOL program (here: ISPEXEC SELECT PGM(MAPPRINT)). I *THOUGHT* I had the source code for that program but I see that I don’t. That means that, unfortunately, this CLIST won’t work. I’m very sorry to have created a “mis-leading” situation. Please accept my apologies.

  3. Thanks for the response.

    I am in need of REXX or CLIST code to View BMS MAP.This will give user to check the map design instantly.

    It would be of great help if you can suggest me rexx or clist code.

    Awaiting for your kind response.

    Regards,
    Syed

  4. Syed,
    I did a little bit of looking around and could not find anything. It’s been nearly 20 years since I’ve been into these modules (I’ve not worked in a mainframe environment since about that time) so I wouldn’t be the best to point you to a solution. I’ve not coded a BMS macro in a long time. While you may be new at REXX, I could suggest that parsing a BMS macro would not be that difficult. Just lots of string manipulation based on how a BMS macro is coded. If it’s a compiled BMS map, then you’d need a disassembler and I’m not sure that this program did that anyway. Perhaps REXX actually CALLING the BMS map might be possible, but I don’t know if REXX can be bound directly to CICS. That’s a bit beyond what I know about.

    Sorry I couldn’t be more help!

Leave a Reply

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