COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Wed June 17, 2020 02:17 AM
    Disclaimer: This post is migrated from IBM Developer Answers that is no longer in use. Its original author is AnthonyKoogler, posted on Apr 17, 2019.

    How Do You Create an ADATA File when Compiling a COBOL Copybook?

    A user is trying to use IBM Record Generator for Java to create helper classes from a COBOL copybook.

    We tried to follow the instructions in the following link. https://www.ibm.com/support/knowledgecenter/SSMQ4D_3.0.0/documentation/cobol_rcg_create_sysadata.html

    Since we are not using a full COBOL program, the compiler complains about missing components in the copybook.

    Is there a way to use the compiler to generate the ADATA file from a copybook?

    -----------------------------------------------------------
    Question asked by AnthonyKoogler on Apr 17, 2019
    -----------------------------------------------------------



  • 2.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Wed June 17, 2020 02:18 AM
    Edited by Yuan Jie Song Wed June 17, 2020 02:19 AM

    Hi Anthony,

    We see that you have opened a PMR for this, but will share the answer for future readers' benefit:

    The IBM Record Generator for Java documentation shows that you can individually select a record definition in the SYSADATA file to generate via the symbol={definition-name} parameter, in the absence of which it uses the first 01 level item found in the file.

    We believe that you can create a dummy COBOL program with all the required syntactic trappings in which you include the copybook(s) that you want to generate and then invoke the generator with the appropriate parameters against the SYSADATA file you get from the compile of that program. Hope this helps!

    Regards, Nicole

    -----------------------------------------------------
    Answered by Nicole Trudeau on Apr 18, 2019
    -----------------------------------------------------





  • 3.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Wed June 17, 2020 02:22 AM
    Edited by Yuan Jie Song Wed June 17, 2020 02:22 AM

    Hello Nicole,

    I created a dummy program like you suggested and I compiled it with the copybook in it. I was able to get the ADATA file.

    Thank you for the help.

    Anthony

    ----------------------------------------------------
    Replied by AnthonyKoogler on Apr 18, 2019
    ----------------------------------------------------






  • 4.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Wed October 30, 2024 06:12 PM
      |   view attached

    Hi, Attached is the Adata file generated after compiling a copybook using  a dummy program. But it was not helpful. Java copy generation ended in error.

    I think Adata file is not poperly generated with right options. Any specific compile options to be used and also the dummy cobol program is enough to be a simple one

    or need a Cobol+CICS program.

    Kindly help me and suggest .



    ------------------------------
    SrinivasaShashikanth Kotla
    ------------------------------

    Attachment(s)

    txt
    Adata_1.txt   35 KB 1 version


  • 5.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Wed October 30, 2024 07:43 PM

    As a member of the compiler team, I can't comment on how another tool is using the ADATA file. The error could very well be in the other tool. It would help to know what error message you got from the other tool, as well as any error messages you got from the compiler.

    As far as the compiler goes:

    - ADATA is the only option you need for the compiler to create an ADATA file.
    - The ADATA accurately reports errors encountered during compilation, so if there were any compiler errors, I'd expect that another tool using the ADATA might not succeed either.
    - ADATA generation should be successful for ANY valid program, no matter how big or small, no matter how many copybooks it uses, as long as compilation is successful.



    ------------------------------
    Mike Chase
    Enterprise COBOL Developer
    mike.chase@ca.ibm.com
    ------------------------------



  • 6.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Mon November 04, 2024 06:50 AM

    Hi Mike,

     

    Thank you very much for you email.

     

    Please find the attached details of the error and also the Adata file produced the Compile JCL in out mainframe environment.

     

    While above adata file was processed in the tool to generate Java version we get the below mentioned error.

     

    Kindly suggest on the way forward to get this error fixed or sorted out.

     

    Tool used is - IBM Record Generator: 3.0.2

     

    >"c:\Program Files (x86)\Java\jdk1.8.0_181\bin\java.exe" -cp ./ibm/* com.ibm.recordgen.cobol.RecordClassGenerator adatafile=ADATA_1.adata outputDir=.  IBM Record Generator for Java V3.0.2 Build 20221206-1121 on: Mon Nov 04 17:06:53 IST 2024 Running with Java version : 1.8.0_181 Error while processing file: ADATA_1.adata java.lang.IllegalStateException: specTree root is not a StorageSpec. May be caused by invalid or corrupt ADATA file, or incorrect symbol name.         at com.ibm.recordgen.cobol.RecordSpecTreeBuilder.process(RecordSpecTreeBuilder.java:226)         at com.ibm.recordgen.cobol.RecordClassGenerator.processFile(RecordClassGenerator.java:400)         at com.ibm.recordgen.cobol.RecordClassGenerator.processLibrary(RecordClassGenerator.java:511)         at com.ibm.recordgen.cobol.RecordClassGenerator.main(RecordClassGenerator.java:325) RecordClassGenerator failed to process at least one file; exitCode=8

     

     

     

     

     

     

     

     

     

     

     

     

    Thanks and Regards

    K.S.Shashikanth

     

     

     

     






  • 7.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Mon November 04, 2024 06:56 AM

    Hi Mike,

     

    Thank you very much for you email.

     

    Please find the attached details of the error and also the Adata file produced the Compile JCL in out mainframe environment.

     

    While above adata file was processed in the tool to generate Java version we get the below mentioned error.

     

    Kindly suggest on the way forward to get this error fixed or sorted out.

     

    Tool used is - IBM Record Generator: 3.0.2

     

    >"c:\Program Files (x86)\Java\jdk1.8.0_181\bin\java.exe" -cp ./ibm/* com.ibm.recordgen.cobol.RecordClassGenerator adatafile=ADATA_1.adata outputDir=.  IBM Record Generator for Java V3.0.2 Build 20221206-1121 on: Mon Nov 04 17:06:53 IST 2024 Running with Java version : 1.8.0_181 Error while processing file: ADATA_1.adata java.lang.IllegalStateException: specTree root is not a StorageSpec. May be caused by invalid or corrupt ADATA file, or incorrect symbol name.         at com.ibm.recordgen.cobol.RecordSpecTreeBuilder.process(RecordSpecTreeBuilder.java:226)         at com.ibm.recordgen.cobol.RecordClassGenerator.processFile(RecordClassGenerator.java:400)         at com.ibm.recordgen.cobol.RecordClassGenerator.processLibrary(RecordClassGenerator.java:511)         at com.ibm.recordgen.cobol.RecordClassGenerator.main(RecordClassGenerator.java:325) RecordClassGenerator failed to process at least one file; exitCode=8

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Thanks and Regards

    K.S.Shashikanth

     

     

     

     






  • 8.  RE: How Do You Create an ADATA File when Compiling a COBOL Copybook?

    Posted Mon November 04, 2024 09:14 AM

    Neither of your last two posts had any attachments. But, attaching an ADATA file here isn't a good idea. It could be a security risk if that's real code - the source code can be derived from a valid ADATA file.

    Opening a Case is the best approach for getting support here.



    ------------------------------
    Mike Chase
    Enterprise COBOL Developer
    mike.chase@ca.ibm.com
    ------------------------------