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.
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:
Specifies whether to build or rebuild a module included in the project file.
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.
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.
Specifies the project file name you wish to build. Note that project files from V3.0 or earlier cannot be specified.
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.
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:
allbuild rebuild c:\temp\allbuild.blg
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
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
Command statements used in batch building are not case sensitive.
Use the "LIB" option for compiling when you specify any copy files using the /cbi option.
If you move a project file to another folder and build the project, PowerCOBOL outputs the message "Would you like to save the project for build or compilation?". You will not be able to use the batch building feature as a result. In this case, check the "Auto Save" in the Build tab of the Option properties dialog. The Option properties dialog is displayed when you select the "Options" option in the "Tools" menu of the Project window.