Exploring the sample files
Within this documentation we refer to a set of sample files that you can use to explore the editor features. These samples are provided on Github.com.
Get the sample files
Assuming that you have Git installed as described in the Prerequisites, create a work directory somewhere on your machine and clone the sample repository:
git clone https://github.com/IBM/zopeneditor-sample.git
Then open the directory zopeneditor-sample using the File > Open... menu. The sample files in this directory will be referred to throughout the rest of the documentation.
Understand the Git repository branches
The sample Git repository contains seven branches with variants of our sample programs for different evaluation use cases.
- main: provides code and configuration file examples that can be used with the basic IBM Z Open Editor installation obtains from the VS Code Marketplace.
- tutorial_complete: extends the examples from the main branch with code changes that you can use to simulate a before and after view of making changes to source code.
- wazi-main: provides additional configuration file examples for commercial extensions to IBM Z Open Editor such as IBM Open Debug, User Build with IBM Dependency-Based Build, Red Hat Ansible Certified Content for IBM Z collection, and GitLab CI. The IBM Documentation has more details for using these tools and examples.
- wazi-tutorial-complete: provides an after-changes-view of the examples in wazi-main with the same advanced configurations files.
- devfile: contains a variant of wazi-main that can be used in Red Hat's Dev Spaces for OpenShift v3 environment. See a tutorial for trying Z Open Editor running in Dev Spaces on Red Hat's free Developer Sandbox in our GitHub repository.
Examine the sample files
The sample application in the main and tutorial-complete branches consists of the following files:
COBOL programs:
SAM1,SAM2, andSAM1LIBSAM1reads in both theCUSTFILEandTRANFILEdata files, and then performs different actions on theCUSTFILEbased on transactions from theTRANFILE. Valid transactions areADD,UPDATE, andDELETE. When anUPDATEtransaction is processed,SAM1callsSAM2to perform the requested update.SAM2includes some base code in place forCRUNCHtransactions, which can be enhanced using Instructions provided later in this document . At the end of processing theTRANFILE,SAM1generates a report on the transactions processed and produces an updatedCUSTFILE.SAM1LIBis included to demonstrate the editor's ability to resolve copybooks that are part of a library. It is a copy ofSAM1with the exception of the library-based copybooks.Copybooks:
CUSTCOPY,REGISTRS, andTRANRECLibraries Copybooks:
DATETIME(local) andREPTTOTL(MVS). These copybooks demonstrate using the libraries option in aCOPY <copybook> IN <library>statement for local and MVS copybooksPL/I programs:
PSAM1,PSAM2, andPSAM1LIBPSAM1reads in both thePLI.CUSTFILEandPLI.TRANFILEdata files, and then produces a report with customer information and a Totals summary section. Valid transactions arePRINTandTOTALS. APRINTtransaction prints the Customer records to the Customer section of the report. WhenPSAM1reads in aTOTALStransaction, it generates the Totals Report section. The instructions, provided later in this document, guide you through making the necessary code changes to allowPSAM1to process a new type of Customer record called a Product record and generate a new line for the Service Calls in the Totals Report section.PSAM1LIBis included to demonstrate the editor's ability to resolve includes that are part of a library. It is a copy ofPSAM1with the exception of the library-based includes.Include files:
BALSTATSandCUSTPLILibraries Includes:
DATETIME(local) andREPTTOTL(MVS) - these includes demonstrate using the libraries option in an%INCLUDE <library> (<include>);statement for local and MVS includesHLASM programs:
ASAM1andASAM2ASAM1reads theASM.FILEINdata file and will write out the record number, column number heading records, and the input string toASM.FILEOUT. Instructions provided later in this document will guide you through making the necessary code changes to haveASAM1callASAM2which will take the input string, convert it to hexadecimal format and pass it back toASAM1, which will then write the hex value for the string to theASM.FILEOUTdata file.REXX program:
RSAM1RSAM1reads theREXX.FILEIN1andREXX.FILEIN2data files and will write out the records toREXX.FILEOUT. Instructions provided later in this document will guide you through making the necessary code changes to create a new subroutine inRSAM1to have it read throughREXX.FILEOUTand display all of the records.JCL members that set up and run the applications:
ALLOCATE,RUN,PLIALLOC,RUNPSAM1,ASMALLOC,RUNASAM1, andREXALLOC.Data source files:
CUSTFILE,TRANFILE,PLI.TRANFILE,PLI.CUSTFILE,ASM.FILEIN,REXX.FILEIN1, andREXX.FILEIN2.Script Files:
zowecli-create-profiles.sh- This shell script will create Zowe CLI RSE and SSH profiles and then set them as the default profiles.- Parameters necessary to run the script:
- TSO USER ID and Password
- Z host address
- RSE API port number
- SSH port number
- Parameters necessary to run the script:
zowecli-cobol-upload-run-simple.sh- This shell script will run the sample COBOL application.- Submits the JCL to allocate the required MVS datasets
- Uploads the application components from the local directory to the MVS datasets
- Submits the JCL to run the application
zowecli-cobol-upload-run-tutorial.sh- This shell script will run the sample COBOL application and download the output files.- Submits the JCL to allocate the required MVS datasets
- Uploads the application components from the local directory to the MVS datasets
- Submits the JCL to run the application
- Downloads the output data files once the JES job is complete
zowecli-cobol-clean.sh- This shell script will delete the MVS data sets allocated and created during the execution of the sample application.