Many development environments have error message display integrated into your editor. After you have built your code, you can see where the errors are in your application without having to look at the output from a compiler. We provide the same capability in the JCL and COBOL editors in RD Traveler.
In this blog, I will describe how we process error messages.
Submitting a Job
When you first edit a JCL or COBOL PDS member, RD Traveler doesn't know about any errors that might be in the code, so the editor has no special annotations to indicate errors.
When you submit JCL, RD Traveler scans the output, looking at each step. On each step, we look at the program name and see if we have an error parser for that program. If we do, we run the error parser and it examines the output files from the step. Which files the error parser looks at varies from program to program (for example, the C compiler writes errors to SYSPRINT whereas we provide a user exit for the COBOL compiler and errors are written to SYSXMLSD. The errors from each of the steps are aggregated and sent back in a standard format to the web client.
The web client then displays error messages on the associated step. In this example, the program has errors on the CREATE and the CCOB steps
If you hover over the error marker, you can see the specific errors:
The web client also remembers the job that was just submitted and associates that job-id with all the source files that had errors in them. So, if you open a source file that had errors in it, those errors are highlighted in the corresponding editor. This gives you a nice way to be able to see all the errors from your compilation steps. In the following example, I've modified the COBOL source and submitted the JCL. This time, the compilation (and the following LINK step) have failed:
If I hover over the COBOL source dataset name and click on it in the JCL, it will open the COBOL source code in another tab, with the errors highlighted. I can use the error marker gap on the far right to locate the offending error in my code (in this case, a typo of FE instead of FD).
If the error had happened in a COBOL copybook, the same process would work - we track errors down to files referenced from other files (as long as the program gives us the information about what file is referenced from where.