Set up and running a COBOL user build
Verify the
copybookRulesetting in theapplication.propertiesfile.Open the
application.propertiesfile in theapplication-conffolder in the VS Code workspace.Search on
copybookRuleand verify the USS location.The default USS location is as follows:
{"sourceDir": "${workspace}", "directory": "${application}/copybook"}
IBM® User Build creates USS folders that align with the VS Code workspace subfolders. For example, if your workspace copybook folder is
zopeneditor-sample/COPYBOOK, then the USS folder location will also be underzopeneditor-sample/COPYBOOK. Therefore, the USS location in thecopybookRuleneeds to match the USS location generated during theuser buildprocess. In this example, the value should be:{"sourceDir": "${workspace}", "directory": "${application}/COPYBOOK"}Now, select a local COBOL program from your workspace to open in the editor and make changes.
After you complete and save your code changes, you can now run a user build.
Right-click in the program that is opened in the editor and select
Run Setup for IBM User Build.The files listed in the
additionalDependenciessetting will be copied from your local workspace to the USS locations. This will only need to run once unless other additional dependencies are needed later. You can verify the files by using theZowe™tree viewer.There are two options for running a user build.
Run IBM User Build with full upload- this option will upload all local copybooks referenced in the program. It would be used anytime you need to re-upload all of the local copybooks to the USS application folder.Run IBM User Build- this option will upload only those copybooks that have been modified since the last upload, or any new copybooks introduced into the program. This option will be used most often and will be the most efficient since it will not upload all copybooks.
Option 1 - Select
Run IBM User Build with full upload. This process determines the copybook dependencies and uploads all local ones along with the COBOL file to the USS file system, and then executes the DBB build script. Since this option will upload all of the copybooks, it should only be used when it is necessary to actually upload all of the copybooks. The COBOL program and copybooks being uploaded will be listed in the output console window as seen here:===================== Running user build... Identified local root workspace path as c:\Users\userid\zopeneditor-sample Uploading c:\Users\userid\zopeneditor-sample\COBOL\SAM1.cbl program. Found total of 2 local copybooks. Updating 2/2 local copybooks. Uploading c:\Users\userid\zopeneditor-sample\COPYBOOK\CUSTCOPY.cpy Uploading c:\Users\userid\zopeneditor-sample\COPYBOOK\TRANREC.cpyOption 2 - Select
Run IBM User Build. This process determines which copybooks have been modified or are new since the last build and will only upload modified and new copybooks with the COBOL file to the USS file system. It then executes the DBB build script. The COBOL program and copybooks being uploaded will be listed in the output console window as seen here:===================== Running user build... Identified local root workspace path as c:\Users\userid\zopeneditor-sample Uploading c:\Users\userid\zopeneditor-sample\COPYBOOK\CUSTCOPY.cpy program. Found total of 2 local copybooks. Checking if copybook files were updated since last build... Updating 0/2 local copybooks.
The DBB build output will also indicate the results of the build in the output console window. A successful build will show a message similar to the following:
** Build ended at Fri Feb 14 08:58:19 EST 2020
** Build State : CLEAN
** Total files processed : 1
** Total build time : 14.877 seconds
** Build finished
Looking for user-build logs in /u/userid/projects/zopeneditor-sample/logs
Downloading logs to c:\Users\userid\zopeneditor-sample\zopeneditor-sample\logs
Downloading log file /u/userid/projects/zopeneditor-sample/logs/buildList.txt. Binary: false
Downloading log file /u/userid/projects/zopeneditor-sample/logs/BuildReport.html. Binary: true
Downloading log file /u/userid/projects/zopeneditor-sample/logs/BuildReport.json. Binary: true
Downloading log file /u/userid/projects/zopeneditor-sample/logs/SAM1.log. Binary: false
Downloading of 4 log files to c:\Users\userid\zopeneditor-sample\logs finished successfully.IBM User Build will automatically download logs from z/OS® into the logs directory on your local workspace. The logs folder will be created if it does not exist.
If you see an ERROR build result, you can view the log produced by DBB. The log is in the uss folder defined in the --outDir setting listed above.
** Build ended at Fri Feb 14 09:08:37 EST 2020
** Build State : ERROR
** Total files processed : 1
** Total build time : 13.552 seconds
** Build finished
Looking for user-build logs in /u/userid/projects/zopeneditor-sample/logs
Downloading logs to c:\Users\userid\zopeneditor-sample\logs
...