 |
» |
|
|
 |
Two UDC's for invoking the COBOL preprocessor are provided with
ALLBASE/SQL in the HPSQLUDC.PUB.SYS file: PCOB, illustrated in Figure 2-12, invokes the
preprocessor in full preprocessing mode. You specify the source
file name, a DBEnvironment name, and a name for SQLMSG (if you
do not want preprocessor messages to go to $STDLIST).
:PCOB SourceFileName,DBEnvironment
|
The PCOB UDC uses the following preprocessor INFO string parameters: ModuleName is the name of the source file. OwnerName is the log-on User@Account. PRESERVE and DROP are in effect.
PPCOB, illustrated in Figure 2-13, invokes the
preprocessor in full preprocessing mode, then invokes the COBOL
compiler if preprocessing is successful and the linker if
compilation is successful.
To use this UDC, you specify the source file name, a
DBEnvironment name, and an executable file name. You can
specify a name for SQLMSG if you do not want preprocessor
messages to go to $STDLIST:
:PPCO SourceFileName,DBEnvironment,ExecutableFileName
|
This UDC uses the following preprocessor INFO string parameters: ModuleName is the source file name. OwnerName is the log-on User@Account. PRESERVE and DROP are in effect.
If you make your own version of the UDC's, do not modify the
record attributes for any of the preprocessor output files.
Only modify the file limit (disc=FileLimit) if required.  |  |  |  |  | NOTE:
Because the UDC's purge the preprocessor message file, if
messages are sent to $STDLIST an error message appears when you
use the UDC's, but preprocessing continues.
|  |  |  |  |
The example in Figure 2-14 illustrates the use of PPCOB on an
SQLIN that could be successfully preprocessed, but failed to
compile because a COBOL error exists in the file. In addition
to generating an error message for the COBOL error, the COBOL
compiler generates several warning messages. The warning
messages are normal and will not cause runtime problems; they
are due to the way the COBOL preprocessor declares some of the
variables in SQLVAR. The line number referenced in the compiler output messages is
the COBOL statement number in the compiler output listing.
Because PPCOB sends the compiler output listing to $null, you
must reinvoke the compiler, sending the compiler listing to an
output file, to identify the line in error:
:BUILD COBLIST;DISC=10000,32;REC=-80,16,F,ASCII
:COB85XL SQLOUT,$OLDPASS,COBLIST
|
The COBOL syntax error flagged in the example in Figure 2-14
appears as follows in COBLIST:
00261 DISPAY "SELECT PartNumber, PartName and SalesPrice".
|
If you use TDP's COBOL mode to create SQLIN, the actual line
number containing any COBOL error in SQLOUT appears in the SEQ
column of the COBOL compiler message. Therefore you can use
this approach to eliminate recompiling in order to identify the
location of COBOL errors. In this case, the error is at line
15.7 in SQLOUT.
LINE SEQ COL ERROR SEV TEXT
-------------------------------------------------------------------
.
.
.
00261 015700 19 410 S SYNTAX ERROR. FOUND: SELECT PartNumber,
PartName and SalesPrice; EXPECTING ONE OF
THE FOLLOWING: . SECTION
.
.
.
|
|