Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

6.2.7 Batch Building

PowerCOBOL can build/rebuild all modules included in a project by using batch mode. The result of the build/rebuild is output into the ".blg" file in the folder where the project file exists.

6.2.7.1 Command Syntax Format

The following format is the command statement used for batch building:

PowerCOB  { /build  |  /rebuild }
[ /Debug  |  /Release ]
[ /cbi:"OPTION-FILE-NAME" ]
"PROJECT-FILE-NAME"

The components of this command statement are:

/build | /rebuild

Specifies whether to build or rebuild a module included in the project file.

/Debug | /Release

Specifies whether to build the module in debug mode or release mode. If the mode is omitted, PowerCOBOL uses the mode specified in the module's properties.

/cbi:"OPTION-FILE-NAME"

Specifies the file that contains compile options. You can create this option file by using the "WINCOB" command. See "How to create an option file" for details. If an option file is specified, the options (both copy folders and copy file names) specified in the script properties are ignored. If the option file is omitted, PowerCOBOL uses the options specified in the script properties.

"PROJECT-FILE-NAME"

Specifies the project file name you wish to build. Note that project files from V3.0 or earlier cannot be specified.

Returning Value

Succeeded: 0

Failed: 1

"Succeeded" implies I-level and W-level errors only. If the project has already been built, the batch building succeeds. See the result file ".blg" for details.

6.2.7.1.1 Example

If you would like to build a project named "c:\project\proj1.ppj":

  powercob /build "c:\project\proj1.ppj"

The result will be output as follows in the "c:\project\proj1.blg".

Create Type Library for compilation...
Create C:\project\Main\Debug\MainForm.cob...
STATISTICS: HIGHEST SEVERITY CODE=I
Revise line information into C:\project\Main\Debug\MainForm.cob...
STATISTICS: HIGHEST SEVERITY CODE=I
Compile C:\project\Main\Debug\MainForm.cob...
STATISTICS: HIGHEST SEVERITY CODE=I, PROGRAM UNIT=1
Compile resource C:\project\Main\Debug\Main.rc...
Linking C:\project\Debug\Main.exe...
** The build was successful **

If you'd like to build a project named "c:\project\proj2.ppj" specifying with an option file and debug mode:

powercob /build /debug /cbi: "c:\project\proj2.cbi" "c:\project\proj2.ppj"

If there are any compile errors, the results are output as follows in the "c:\project\proj2.blg" file.

Create Type Library for compilation...
Create C:\project\Sub\Debug\SubForm1.cob...
STATISTICS: HIGHEST SEVERITY CODE=I
Revise line information into C:\project\Sub\Debug\SubForm1.cob...
STATISTICS: HIGHEST SEVERITY CODE=I
Compile C:\project\Sub\Debug\SubForm1.cob...
** DIAGNOSTIC MESSAGE ** (SUBFORM1)
SubForm1 SubForm1-Opened(5) : JMN2503I-S  USER WORD 'DATA1' IS UNDEFINED.
SubForm1 SubForm1-Opened(5) : JMN2557I-S  FORMAT OF DISPLAY STATEMENT IS INCOMPLETE.
STATISTICS: HIGHEST SEVERITY CODE=S, PROGRAM UNIT=1
** The build has failed **

If you'd like to build a multiple number of projects, create a batch file and execute the command as follows:

6.2.7.1.2 Batch command
  allbuild rebuild c:\temp\allbuild.blg
6.2.7.1.3 Contents of the batch file "allbuild.bat"
ECHO OFF

ECHO ##### C:\project\proj1.ppj ##### >> %2 ECHO POWERCOB /%1 "C:\project\proj1.ppj" START /WAIT POWERCOB /%1 "C:\project\proj1.ppj" IF ERRORLEVEL 1 ECHO !!! %1 Error !!! TYPE C:\project\proj1.blg >> %2 ECHO ##### C:\project\proj2.ppj ##### >> %2 ECHO POWERCOB /%1 "C:\project\proj2.ppj" START /WAIT POWERCOB /%1 "C:\project\proj2.ppj" IF ERRORLEVEL 1 ECHO !!! %1 Error !!! TYPE C:\project\proj2.blg >> %2 ... :END
6.2.7.1.4 How to create an option file

You can create a compile option file by using the "WINCOB" command. Execute the command and then display the compile option dialog box to specify compile directives.

  WINCOB -iOPTIONFILE-NAME

For example, if you create an option file named "C:\project\proj2.cbi", specify as follows:

  WINCOB -iC:\project\proj2.cbi

Refer to the NetCOBOL User's Guide for details of the WINCOB command.

Notes