Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving ISPF 'MESSAGE' lines - possible? 1

Status
Not open for further replies.

ShawnStanford

Programmer
Jan 2, 2001
14
US
Hi all.

I'm in a Big Iron shop working with a JCL checker called 'JEM' (at least, that's the command line for it). It throws up a series of messages showing me what it didn't like about the JCL it's checking, including files it didn't find. Most of the time, I'm looking for a test version of a production file and, if it's not there, I want to create a test copy from the production file. So, I'd like to write a REXX macro that will grab these messages, check for a file name and write IDCAMS instructions for the create and repro.

So, is it possible to grab message lines from the editor? If so, how? I have the ISPF Edit/Edit Macros book from IBM and it wasn't helpful...

Here's a screen cap showing what I mean:

Code:
 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
 ———————————————————————————————————————————————————————————————————————————————
 EDIT       SSS049.JCL.LIBRARY(A710BX13) - 01.06            Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 ****** ***************************** Top of Data ******************************
 ==MSG> *** ERROR SUMMARY AND COUNTS ***   JEM  6.2.4A    06/16/2005  10:45:29
 ==MSG>    31  ADVISORY LEVEL
 ==MSG>     2  WARNING LEVEL
 ==MSG>    30  ERROR LEVEL
 ==MSG>    63  TOTAL ISSUED        0 SUPPRESSED.
 ==MSG>      THE HIGHEST SEVERITY CODE ENCOUNTERED WAS    08.
 ==MSG>  LABEL   SV MSG.NO.    ERROR MESSAGE
 ==MSG> -------- -- --------   -------------------------------------------------
 ==MSG> .JAAA     8 DSS4050E - DATA SET NOT FOUND IN CATALOG
 ==MSG> .JAAA     0 DSS8900A - DSN = "VX.A710.C13.S01.VB5100.VCBRE.X "
 ==MSG> .JAAA     8 DSS4050E - DATA SET NOT FOUND IN CATALOG
 ==MSG> .JAAA     0 DSS8900A - DSN = "VX.A710.C13.S01.VB5000.VTAXDG.X "
 ==MSG> .JAAA     8 DSS4050E - DATA SET NOT FOUND IN CATALOG
 ==MSG> .JAAA     0 DSS8900A - DSN = "VX.A710.C13.S01.VH3320.VSMRF.X "
 ==MSG> .JAAA     8 DSS4050E - DATA SET NOT FOUND IN CATALOG
 ==MSG> .JAAA     0 DSS8900A - DSN = "VX.A.U13.V01.FA.VACDT "
 ==MSG> .JAAA     8 DSS4050E - DATA SET NOT FOUND IN CATALOG
 ==MSG> .JAAA     0 DSS8900A - DSN = "VX.A.D13.V01.VPBCTR.VBCTR "
 
You can certainly get the contents of data lines in the editor into macro variables, and add message lines from a macro. But the following quote from the guide
MSGLINE
The line inserted is a temporary, non-data line. The line command area contains ==MSG> in high intensity and the data on the line is also in high intensity. A message line has a data length of 72 characters, regardless of the data width. [red]Once it has been added to the data, it cannot be referenced.[/red]
kind of indicates that you can't do it. It's a shame, as the messages themselves seem to have a nice regular format for parsing, so it should be easy enough to do what you want once you have extracted the message lines.

Can you run JEM in batch mode and send the output to a dataset, then use REXX to parse the file instead? You may even be able to allocate all the files it needs in a REXX, and execute the 'batch' in the foreground by calling the program, which would at least make it appear a bit slicker.
 
Can you run JEM in batch mode and send the output to a dataset, then use REXX to parse the file instead? You may even be able to allocate all the files it needs in a REXX, and execute the 'batch' in the foreground by calling the program, which would at least make it appear a bit slicker.
Yeah, that's an idea. I already have a macro set up to handle compiles that way, so I can steal a lot of the code. It just seemed to me that since I could type 'MD' (Make Data) into a message line and stuff it into the editor, I ought to be able to grab them somehow. Clearly the editor knows they're there and knows what's in them.

Thanks for the input.
 
It would be worth checking an up-to-date manual - I just checked the Boulder site and picked the first one I hit. Normally line commands have analogues in the macro world, so you might be able to 'MD' it, get the data, then remove it again. Maybe...
 
The REXX-lines beneath will put the screen buffer into a stem called LINE. The message lines can easily be selected from the stem.

SCR = TRANSLATE(ZSCREENI)
PARSE VAR SCR SCR 'LINE' L 'COL' COL1 COL2 .
SCRNW = COL2 - COL1 + 1
File = WORD(SUBSTR(ZSCREENI,2*SCRNW+11),1)
XL_MAX = TRUNC(LENGTH(ZSCREENI) / SCRNW)
IF LENGTH(ZSCREENI) // SCRNW > 0 THEN XL_MAX = XL_MAX + 1
DO XL = 1 TO XL_MAX
LINE.XL = SUBSTR(ZSCREENI,(XL-1)*SCRNW+1,SCRNW)
END
 
That code initially didn't work for me. However, it did give me a critical hint, so a quick Google search for 'rexx screeni' turned up the missing piece:
Code:
/* REXX */

ADDRESS ISPEXEC
'VGET (ZSCREENI,ZSCREENC,ZENVIR)'
SAY ZSCREENI

RETURN

which returns this:
Code:
    File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
   -----------------------------------------------------------------------------
 -- EDIT       SSS049.REXX.LIBRARY(TEST1) - 01.06              Columns 00001 000
 72  Command ===> tso test1                                        Scroll ===> C
 SR   ****** ***************************** Top of Data *************************
 ***** 000001 /* REXX */
        000002
         000003 ADDRESS ISPEXEC
          000004 'VGET (ZSCREENI,ZSCREENC,ZENVIR)'
           000005 SAY ZSCREENI
            000006
             000007 RETURN
              ****** **************************** Bottom of Data ***************
 *************
 ***

An interesting technique, but not what I was looking for, since the message lines might extend quite a ways.

Thanks for your time, though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top