 |
» |
|
|
|
Two UDCs for invoking the PASCAL preprocessor are provided with
ALLBASE/SQL in the HPSQLUDC.PUB.SYS file: PPAS, illustrated in Figure 2-15, 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). See Figure 2-16.
:PPAS SourceFileName,DBEnvironment
|
The PPAS UDC uses the following preprocessor parameters: ModuleName is the name of the source file.
OwnerName is the logon User@Account.
PRESERVE and DROP are in effect.
PPPAS, illustrated in Figure 2-16, invokes the preprocessor in
full preprocessing mode, then invokes the PASCAL compiler if
preprocessing is successful, and then 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:
:PPPAS SourceFileName, DBEnvironmentName, ExecutableFileName
|
This UDC uses the following preprocessor INFO string parameters: ModuleName is the source file name.
OwnerName is the logon User@Account.
PRESERVE and DROP are in effect.
 |  |  |  |  | NOTE:
If you make your own version of the UDCs, do not modify the
record attributes for any of the preprocessor output files.
Only modify the file limit (disc=FileLimit) if required.
Because the UDCs purge the preprocessor message file, if
messages are sent to $STDLIST, an error message appears when you
use the UDCs, but preprocessing continues.
|  |  |  |  |
Figure 2-15 UDC for Preprocessing SQLIN
PPAS srcfile,dbefile,msgfile=$stdlist
continue
setvar _savefence hpmsgfence
setvar hpmsgfence 2
continue
purge !msgfile
purge sqlout
purge sqlmod
purge sqlvar
purge sqlconst
purge sqltype
purge sqlextn
setvar hpmsgfence _savefence
deletevar _savefence
file sqlin = !srcfile
file sqlmsg = !msgfile; rec=-80,16,f,ascii
file sqlout; disc=10000,32; rec=-80,16,f,ascii
file sqlmod; disc=1023,10,1; rec=250,,f,binary
file sqlvar; disc=2048,32; rec=-80,16,f,ascii
file sqlconst; disc=2048,32; rec=-80,16,f,ascii
file sqltype; disc=2048,32; rec=-80,16,f,ascii
file sqlextn; disc=2048,32; rec=-80,16,f,ascii
continue
run psqlpas.pub.sys;info="!dbefile (drop)"
reset sqlin
reset sqlmsg
reset sqlout
reset sqlmod
reset sqlvar
reset sqlconst
reset sqltype
reset sqlextn
|
Figure 2-16 UDC for Preprocessing, Compiling, and Preparing SQLIN
PPPAS srcfile,dbefile,pgmfile,msgfile=$stdlist
continue
setvar _savefence hpmsgfence
setvar hpmsgfence 2
continue
purge !msgfile
purge sqlout
purge sqlmod
purge sqlvar
purge sqlconst
purge sqltype
purge sqlextn
setvar hpmsgfence _savefence
deletevar _savefence
file sqlin = !srcfile
file sqlmsg = !msgfile; rec=-80,16,f,ascii
file sqlout; disc=10000,32; rec=-80,16,f,ascii
file sqlmod; disc=1023,10,1; rec=250,,f,binary
file sqlvar; disc=2048,32; rec=-80,16,f,ascii
file sqlconst; disc=2048,32; rec=-80,16,f,ascii
file sqltype; disc=2048,32; rec=-80,16,f,ascii
file sqlextn; disc=2048,32; rec=-80,16,f,ascii
continue
run psqlpas.pub.sys;info="!dbefile (drop)"
if jcw <= warn then
continue
pasxllk sqlout,!pgmfile,$null
endif
reset sqlin
reset sqlmsg
reset sqlout
reset sqlmod
reset sqlvar
reset sqlconst
|
The example in Figure 2-17 illustrates the use of PPPAS on an
SQLIN that could be successfully preprocessed, but failed to
compile because a Pascal error exists in the file. Figure 2-17 Sample UDC Invocation
:PPPAS pasex2,PartsDBE,pasex2p
FRI, AUG 7, 1990, 3:43 PM
36216-02A.E1.00 PASCAL Preprocessor/3000 ALLBASE/SQL
(C) COPYRIGHT HEWLETT-PACKARD CO. 1982,1983,1984,1985,1986,
1987,1988,1989,1990,1991. ALL RIGHTS RESERVED.
SQLIN = PASEX2.SomeGrp.SomeAcct
DBEnvironment = PartsDBE
Module Name = PASEX2
1 Sections stored in DBEnvironment.
0 ERRORS 0 WARNINGS
END OF PREPROCESSING
END OF PROGRAM
PAGE 1 HEWLETT-PACKARD HP (part no.) PASCAL/3000(C)
HEWLETT-PACKARD
CO. ...
81 286.000 1 writln('Begin Work');
^
**** ERROR # 1 IDENTIFIER NOT DEFINED (014)
NUMBER OF ERRORS = 1 NUMBER OF WARNINGS = 0
PROCESSOR TIME 0: 0:13 ELAPSED TIME 0: 0:25
NUMBER OF LINES = 455 LINES/MINUTE = 2100.0
pascalxl.pub.sys;parm=7;info=" "
PROGRAM TERMINATED IN AN ERROR STATE. (CIERR 976)
COMPILE STEP FAILED, NO LINK WAS DONE.
|
|