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 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 always return a value of 14.
Errors during execution of your procedure return a value of 1.
| Attribute | Description | Type | Requirement | Default value |
|---|---|---|---|---|
| procedure | Procedure to execute | String | Required | No default value |
| graphicalMode | True if you want to execute procedure using prowin32, _progres otherwise |
Boolean | Optional | False (_progres) |
| baseDir | The directory in which the Progress runtime should be executed. | File | Optional | Current Ant's directory |
| failOnError | Stop the build process if the Progress procedure exits with a return value other than 0. | Boolean | Optional | True |
| debugPCT | True to keep internal temporary files on disk | Boolean | Optional | False |
| centuryYearOffset | Century Year Offset (-yy parameter) | Integer | Optional | Progress default |
| cpInternal | Internal code page (-cpinternal parameter) | String | Optional | No default value |
| cpStream | Stream code page (-cpstream parameter) | String | Optional | No default value |
| cpColl | Collation table (-cpcoll parameter) | String | Optional | No default value |
| cpCase | Case table (-cpcase parameter) | String | Optional | No default value |
| dirSize | The number of compiled procedure directory entries (-D parameter) | Integer | Optional | Progress default |
| inputChars | The number of characters allowed in a single statement (-inp parameter) | Integer | Optional | Progress default |
| maximumMemory | The amount of memory allocated for r-code segments (-mmax parameter) | Integer | Optional | Progress default |
| parameter | Parameter (-param parameter) | String | Optional | No default value |
| stackSize | Stack size in 1KB units (-s parameter) | Integer | Optional | Progress default |
| token | The number of tokens allowed in a 4GL statement (-tok parameter) | Integer | Optional | Progress default |
| compileUnderscore | COMPILE statement allows underscores (-zn parameter) | Boolean | Optional | False |
| paramFile | Parameter file (-pf parameter). -pf is always the first argument on the command line. | File | Optional | No default value |
| iniFile | Use a .ini file (adds -basekey INI -ininame ...). Attribute is skipped if file can't be found | File | Optional | No default value |
| TTBufferSize | Buffer Size for Temporary Tables (-Bt attribute) | Integer | Optional | Progress default |
| MsgBufferSize | Message buffer size (-Mm attribute) | Integer | Optional | Progress default |
| NumSep | Thousands separator. Can be either a numeric value or a character, e.g. numsep="44" or numsep="," | String | Optional | Progress default |
| NumDec | Fractional separator. Can be either a numeric value or a character, e.g. numdec="46" or numdec="." | String | Optional | Progress default |
| DebugReady | Port on which debugger should connect (disabled by default) | String | Optional | No default value |
| tempDir | Temporary directory for Progress runtime (-T parameter) | File | Optional | Progress config file default |
| resultProperty | The name of a property in which the return code of the Progress procedure should be stored. Only of interest if failonerror=false. | String | Optional | No default value |
| assemblies | .Net assemblies directory (-assemblies parameter). Attribute is skipped if file can't be found | File | Optional | No default value |
| verbose | Tells underlying procedure to be verbose (see footnote) | Boolean | Optional | False |
| noErrorOnQuit | Set to true to prevent PCT from returning an error (code 66) when a QUIT statement is executed | Boolean | Optional | False |
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 prowin32 or _progres 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. | Yes |
| 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