IBM Z and LinuxONE IBM Z

IBM Z

The enterprise platform for mission-critical applications brings next-level data privacy, security, and resiliency to your hybrid multicloud.

 View Only
  • 1.  How to compile a cobol program using IDZ

    Posted Wed March 22, 2023 09:20 AM

    Hello everyone, good day.

    I'm starting to learn IBM developer for z/OS, is like eclipse ide but for mainframe. I've been practicing  COBOL programs there and I like it. The thing is that I don't know how to compile these programs. When I am in TSO/ISPF I do it from ENDEVOR option.

    I already know how to create a cobol member in the library, even add it to endevor through IDZ using deposits CARMA, but I was not be able to find documentation about compilation.

    Excuse my english, and thanks for the help



    ------------------------------
    Yonder Gomez
    ------------------------------


  • 2.  RE: How to compile a cobol program using IDZ

    Posted Thu March 23, 2023 11:53 AM

    Hi Yonder,

    I've found some pretty good examples online that I thought I'd share with you.

    Here is a good example of user-written JCL to compile - https://www.ibm.com/docs/en/cobol-zos/6.4?topic=programs-example-user-written-jcl-compiling

    This page has links that tell you what each card is such as sysin, syslib, sysprint, etc - https://www.ibm.com/docs/en/cobol-zos/6.4?topic=zos-defining-compiler-input-output


    Here is a good URL to get compile JCL for a batch DB2 COBOL program.  The author placed numbers beside some lines and at the bottom of the page he lets you know what each of those files represents, such as the PDS where the DBRM goes, the location of the program, the DCLGEN, etc. Here is the page:

    http://www.mainframegurukul.com/tutorials/database/db2_tutorials/sample-db2-cobol-compile-jcl.html

    Hope that helps! 

    Mary



    ------------------------------
    Mary Irby
    ------------------------------



  • 3.  RE: How to compile a cobol program using IDZ

    Posted Fri March 24, 2023 01:31 PM

    I think the user wants to use Endevor to compile but invoke it through iDZ, he does not want to use JCL.



    ------------------------------
    Tom Ross
    ------------------------------



  • 4.  RE: How to compile a cobol program using IDZ

    Posted Fri March 24, 2023 02:52 PM

    It sounds like the OP is using the IDz plugins for the Eclipse IDE.  Broadcom also has plugins for Endevor that enable the IDE user to interact with Endevor running on z/OS.

    This page describes the plugins for each of the current levels of Endevor.



    ------------------------------
    Scott Fagen
    ------------------------------



  • 5.  RE: How to compile a cobol program using IDZ

    Posted Sun March 26, 2023 02:58 PM

    Hello @Yonder Gomez !

    As you mentioned, IDz does have the ability to to integrate using CARMA https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=releases-accessing-ca-endevor-software-change-manager-scm) as an SCM and Library system.

    It would ideally be your DevOps CICD pipeline that would typically handle the rest of the steps from a trigger, whether a User or personal build or the process to have a full build.  With a pipeline, the steps are abstracted and codified into automation to do all proper steps.  If you have this already, this may be with an existing option in the Eclipse IDE via another plugin provided, or through Dependency Based Build, or a Menu Manager action.  I would check if there is menu option if you right click on the source viewer or the COBOL member or file that indicates a user or personal build option.   If you do not have such an option in your shop, you can look at implementing a pipeline and a user build strategy.

    To familiarize yourself with options and configurations for source code management integration, DevOps, and CICD pipelines on the mainframe that may be familiar tools if you have worked or learned with outside of the mainframe, there is some excellent information about using git as a source code management for your mainframe development at https://www.ibm.com/training/collection/zdevopstransformationcicdpipelineswithdbbgit

    Independent of the SCM, you may want and be able to build the COBOL directly in  the remote or local project ( you may have the project checkout out or are viewing/browsing.).

    If this is the case, you could possibly be able to submit a JCL to do the steps.  

    Mary Irby is exactly correct on how to compile the COBOL. 

    With IBM Developer for z/OS, you have an option to compile, link, and go by generating JCL from the COBOL program itself using the tooling.  In this case what you are looking for is the "compile" step and possibly the "link" step. ( and likely then later the "go" to se it in action). IBM Developer for z/OS has an option Generate JCL that will generate the JCL to either link, link and compile, or link and compile and go; you can examine the JCL for each to see exactly what is going to happen for the step. See https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=jcl-generating-submitting-tracking-viewing-output  

    There is a step by step example that you can use, by doing the Global Auto Mart example, which will show how to assemble, compile, link, and run with IBM Developer for z/OS. https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=projects-compile-global-auto-mart-sample

    Note that if you are using the compile as a check, it may be better to use the remote syntax check capability in IDz to supplement the realtime syntax check instead: https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=dependencies-checking-syntax

    In case you were unaware, there is free training for IBM Developer for z/OS that you can take if you are interested and think it would be helpful.  Check out https://ibm.github.io/mainframe-downloads/Training/Training.html which has free self paced online learning with a badge (see https://ibm.github.io/mainframe-downloads/DevOps_Acceleration_Program/idz-self-paced-learning.html ) as well as a free instructor led set of workshops:  https://ibm.github.io/mainframe-downloads/Training/idzrdz-remote-training.html and for the badge see https://ibm.github.io/mainframe-downloads/Training/adfz-instructor-led-learning.html .  All of the training materials are also already available in case you want to sneak a peak at any particular section or can't make a session.

    Hope this helps!



    ------------------------------
    Gerald Mitchell
    Gerald.Mitchell@ibm.com
    ------------------------------



  • 6.  RE: How to compile a cobol program using IDZ
    Best Answer

    Posted Mon March 27, 2023 09:15 AM

    Hi Yonder,

    If you use ISPF and ENDEVOR to compile then you will know that you must use the ENDEVOR options such as the GENERATE command to compile, probably use other common ENDEVOR command such as sign-in, sign-out, retrieve ,move.

    In IDz, you mention CARMA.  From memory there are two CARMA views you can use to see your elements in Endevor.  Once you have this setup by adding the Endevor filter options such as system, sub-system, element type.  You should see your elements such as Cobol.  Right clicking the element in the CARMA view will give you the same Endevor options as you see in ISPF.  So, select the Generate option, fill in the details (such as your CCID,system,sub-system, processor group) and all being well it should submit a job to compile (should be exactly the same as what you see through ISPF).  It does work.



    ------------------------------
    Alwyn Roberts
    ------------------------------



  • 7.  RE: How to compile a cobol program using IDZ

    Posted Tue March 28, 2023 11:22 AM

    Hello @Yonder Gomez 

    The source code management may be set up independently of the build processes, so it is possible that you may need to compile and build yourself for personal builds.

    The  option you mention you use, Broadcom Endevor,  is a non-IBM vendor product, as Scott Fagen and Tom Ross mention.  As you mentioned,  IDz ability to use CARMA interact with that product is described in https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=releases-accessing-ca-endevor-software-change-manager-scm) or you may have IDE  plugins from the third-party product to supply that functionality. 

    As it is operating as the SCM / library, you would be interact to the SCM chain to do actions on the COBOL files checked in to the SCM/library directly, which may vary on capability depending on installation.  If you have a DevOps CICD pipeline with the SCM,  you may have specific actions or triggers currently ( Check-in, time, specific commands to issue) or not setup for user or personal builds directly.  If there is not a pipeline option available to you currently, you may need to use the JCL, or create your own pipeline: you can setup a user build with the correct permissions and DBB with zAppBuild that would allow you to have consistent user builds to compile and link as well as chaining in any testing that you would want. If you want to familiarize yourself with other options for source code management (SCM), DevOps, and CICD pipelines on the mainframe that may be familiar tools if you have worked or learned with outside of the mainframe, there is some excellent information about using git as a source code management for your mainframe development at https://www.ibm.com/training/collection/zdevopstransformationcicdpipelineswithdbbgit

    I am happy to discuss the pipeline with you, if you would like.

    It is also possible that just the JCL compile and go is enough for now if you are in your learning journey.   If you are referencing the SCM but have checked out the file or accessing the project and are doing an independent action to compile, then you can use a JCL to  drive the compile step.

    With IBM Developer for z/OS, you have an option to assemble, compile, link, and by generating from the COBOL program itself using the tooling for generating the JCL Mary Irby sent references for.  I would encourage you learn about how the COBOL language achieves the steps from source code to running  with JCL as you are learning, so that you can be aware of the language behavior and how to do the steps this way.  In this case what you are looking for is the "compile" step and possibly the "link" step if needed. ( You will also be likely interested in the "go" to se it in action). There is a step by step example that you can use, by doing the Global Auto Mart example, which will show how to assemble, compile, link, and run with IBM Developer for z/OS.

    IBM Developer for z/OS option for Generate JCL  by right click on the COBOL member/ file will give the generate the JCL to either link, link and compile, or link and compile and go; you can examine the JCL for each in order to see exactly what is going to happen for the step. See https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=jcl-generating-submitting-tracking-viewing-output

    I would also point you to the remote syntax check if you are using the compile as a check for validity ass that can be done without generating the object,  see https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=syntax-checking-remotely and https://www.ibm.com/docs/en/developer-for-zos/16.0?topic=dependencies-checking-syntax

    In case you were unaware, there is free training for IBM Developer for z/OS. 

    Check out https://ibm.github.io/mainframe-downloads/Training/Training.html which has free self paced online learning with a badge (see https://ibm.github.io/mainframe-downloads/DevOps_Acceleration_Program/idz-self-paced-learning.html ) as well as a free instructor led set of workshops:  https://ibm.github.io/mainframe-downloads/Training/idzrdz-remote-training.html and for the badge see https://ibm.github.io/mainframe-downloads/Training/adfz-instructor-led-learning.html

    All of the training materials are also already available in case you want to sneak a peak at any particular section or can't make a session.



    ------------------------------
    Gerald Mitchell
    Gerald.Mitchell@ibm.com
    ------------------------------



  • 8.  RE: How to compile a cobol program using IDZ

    Posted Tue April 04, 2023 11:07 AM

    Thank you all for your answers, they really were of great value to achieve the goal. I was able to compile using the CARMA tool in IDZ, for now I can only compile online because if I try to do a "submit job in batch" it returns a security violation error, so I'm afraid I need some configurations with the JCL card, but the problem can now be considered as solved.

    Gerald Mitchell I know a bit about devops and pipelines, but in linux environments, programming in other languages, using jenkins, gitlab, etc. But I have never done such a thing in a mainframe environment, the truth is that I have been learning mainframes for 7 months (COBOL, JCL, TSO, etc.) so it would be great if you suggest me some course or material to start implementing devops on mainframes and create a pipeline. I will be reviewing the links you sent me to continue learning from all this.

    And again, thanks to everyone.



    ------------------------------
    Yonder Gomez
    ------------------------------