Repository navigation
PCTRun
Executes a Progress procedure.
This task generates a temporary Progress procedure on the fly which sets the propath and declares database aliases according to specified parameters, and then runs the specified procedure.
This temporary procedure is launched by an Exec task, with prowin, prowin32 or _progres executable, and with the specified arguments.
You need to add RETURN "IntegerValue" at the end of your procedure. This return value is read by PCT, and any non-zero value tells Ant to throw an exception (thus stopping the build).
- Database connection problems ⇒ return value 14
- Errors during execution of your procedure ⇒ return value 1
- QUIT statements ⇒ return value 66
<pct:run />
| Attribute | Description | Required |
|---|---|---|
| procedure | Procedure to execute | ✔ |
| graphicalMode | True if you want to execute procedure using prowin32, _progres otherwise. Default value is false |
|
| baseDir | The directory in which the OpenEdge runtime should be executed. Default value is build.xml basedir | |
| failOnError | True to throw a build exception if the OpenEdge procedure exits with a return value other than 0. Default value is true | |
| debugPCT | True to keep internal temporary files on disk. | |
| centuryYearOffset | Century Year Offset (-yy parameter) | |
| cpInternal | Internal code page (-cpinternal parameter) | |
| cpStream | Stream code page (-cpstream parameter) | |
| cpColl | Collation table (-cpcoll parameter) | |
| cpCase | Case table (-cpcase parameter) | |
| dirSize | The number of compiled procedure directory entries (-D parameter) | |
| inputChars | The number of characters allowed in a single statement (-inp parameter) | |
| maximumMemory | The amount of memory allocated for r-code segments (-mmax parameter) | |
| parameter | Parameter (-param parameter) | |
| stackSize | Stack size in 1KB units (-s parameter) | |
| token | The number of tokens allowed in a 4GL statement (-tok parameter) | |
| compileUnderscore | COMPILE statement allows underscores (-zn parameter) | |
| paramFile | Parameter file (-pf parameter). -pf is always the first argument on the command line. | |
| iniFile | INI file (adds -basekey INI -ininame ...). Attribute is skipped if file can't be found | |
| TTBufferSize | Buffer Size for Temporary Tables (-Bt attribute) | |
| MsgBufferSize | Message buffer size (-Mm attribute) | |
| NumSep | Thousands separator. Can be either a numeric value or a character, e.g. numsep="44" or numsep="," | |
| NumDec | Fractional separator. Can be either a numeric value or a character, e.g. numdec="46" or numdec="." | |
| DebugReady | Port on which debugger should connect (disabled by default) | |
| tempDir | Temporary directory for Progress runtime (-T parameter) | |
| resultProperty | The name of a property in which the return code of the Progress procedure should be stored. Only of interest if failOnError is set to false. | |
| assemblies | .Net assemblies directory (-assemblies parameter). Attribute is skipped if file can't be found | |
| verbose | Tells underlying procedure to be verbose (see footnote) | |
| noErrorOnQuit | Set to true to prevent PCT from returning an error (code 66) when a QUIT statement is executed |
Adds a database connection on startup
Adds a group of database connection on startup
Creates a nested propath, and adds it to the implicit propath.
Option (or PCTRunOption)
Adds an additional command line option to OpenEdge executable. These options are always appended at the end of the standard command line (before -p parameter).
WARNING : an option containing a space will be surrounded by quotes. If a value is needed by a parameter, add it in the value attribute. This is needed if the value contains spaces for example.
Creates a parameter which can be read in the called procedure using DYNAMIC-FUNCTION('getParameter' IN SOURCE-PROCEDURE, INPUT 'ParameterName'). Returned value type is CHARACTER. If parameter is not defined, the function returns ?.
WARNING : these parameters are written in a temp-table without unique index. Defining a parameter with same name multiple times may lead to weird results (it will return ?).
Adds a character OUTPUT PARAMETER to the called procedure. This value is then written to the specified Ant property.
Defines profiler options.
Adds aliases on DB connection
It is possible to specify environment variables to pass to the system command via nested <env> elements.
| Attribute | Description | Required |
|---|---|---|
| key | The name of the environment variable. Note: (Since Ant 1.7) For Windows, the name is case-insensitive. | ✔ |
| value | The literal value for the environment variable. | Only one of value/path/file |
| path | The value for a PATH like environment variable. You can use ; or : as path separators and Ant will convert it to the platform's local conventions. | |
| file | The value for the environment variable. Will be replaced by the absolute filename of the file by Ant. |
The main procedure generated by PCT and calling your own procedure always contain a shared variable definition :
DEFINE NEW SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO INITIAL True/False.
The main procedure will also display some information is verbose is set to true (such as propath, database connections, parameters, and so on). In your own procedure, you can take advantage of this variable to display some information based on this verbose attribute :
DEFINE SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO.
IF pctVerbose THEN MESSAGE "Entering foo.p".
...
<PCTRun procedure="test.p" dlcHome="${env.DLC}" />Commandline : ${env.DLC}/bin/_progres -b -p test.p
<PCTRun procedure="test/test.p" dlcHome="${env.DLC}" graphicalMode="true" parameter="foobar" />Commandline : ${env.DLC}/bin/prowin32 -b -param foobar -p test/test.p
<pct:run procedure="test/test.p" dlcHome="${env.DLC}" graphicalMode="true" parameter="foobar">
<DBConnection dbName="foo" dbDir="base" singleUser="true">
<PCTAlias name="foo2" />
<PCTAlias name="foo3" />
</DBConnection>
<DBAlias name="foo4" value="foo" />
<propath>
<pathelement path="src/include" />
<pathelement path="src/include2" />
</propath>
<Option name="-cprcodeout" value="utf-8" />
<Parameter name="Param1" value="Value1" />
<Parameter name="Param2" value="Value2" />
<OutputParameter name="FirstParam" />
<OutputParameter name="SecondParam" />
</pct:run>Commandline : ${env.DLC}/bin/prowin32 -b -param foobar -cprcodeout utf-8 -p pctinitxxxx.p
Procedure test/test.p could be:
/* Two OutputParameter nodes */
define output parameter param1 as character no-undo.
define output parameter param2 as character no-undo.
{ myinclude.i } /* Will be found in src/include and src/include2 */
find first foo.MyTable. /* As foo database is connected */
find first foo2.MyTable. /* As foo2 is an alias */
find first foo3.MyTable. /* As foo3 is also an alias */
define variable myvar as char no-undo.
assign myvar = dynamic-function('getParameter' in source-procedure, 'Param1').
display myvar. /* will display Value1 */
assign param1 = foo.MyTable.Field1.
assign param2 = foo.MyTable.Field2.
if (somecondition) then
return '0'. /* Don't forget to return a value */
else
return '20'. /* Any non-zero value is an error */
After PCTRun task execution, Ant properties FirstParam and SecondParam can be accessed with ${FirstParam} and ${SecondParam}, e.g.
<echo message="FirstParam is ${FirstParam} and SecondParam is ${SecondParam}" />- QuickStart
- Changelog
- InstallDocumentation
- FAQ
-
Tasks
- PCT
- DlcHome
- PCTRun
- PCTDynRun
- PCTCompile
- PCTWSComp
- PCTCreateDatabase
- Sports2000
- Sports2020
- PCTDependencies
- PCTDumpSchema
- PCTDumpSequences
- PCTLoadSchema
- PCTIncrementalDump
- PCTBinaryDump
- PCTBinaryLoad
- PCTDumpData
- PCTLoadData
- PCTSchemaDoc
- PCTLibrary
- PCTProxygen
- PCTXCode
- ProgressVersion
- PCTVersion
- ClassDocumentation
- JsonDocumentation
- ABLUnit
- RestGen
- AssemblyCatalog
- Types
© Progress Software Corporation 2003-2026