IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
47 stars 25 forks source link

Not able to resolve includes and copybooks #309

Closed mahadea closed 1 year ago

mahadea commented 1 year ago

Development environment used

Problem Description

Detailed steps for reproducing the problem:

  1. First step

Observed behavior

I downloaded a cobol source file to my PC. I created a folder called C:\Cobol and put this file in there with the extension .cbl, so MYPGM.cbl. This source has a few INCLUDEs and COPY members. I created a subfolder in C:\Cobol and downloaded all those members in there with the extension .cpy, so CPYBOOK1.cpy, INCLUDE1.cpy and so on. In the C:\Cobol folder I have a zapp.yaml file. These are the contents of the file

` name: sample-zapp description: Wazi's code samples with COBOL application version: 1.1.0 author: name: IBM CORPORATION ###############################################################

This property group tells our extension to do the following:

#   First, look for copybooks inside local COPYBOOK folder
#   Second, look for copybooks on remote MVS syslib
###############################################################
propertyGroups:
  - name: cobol-copybooks
    language: cobol
    compilerOptions: ~(OR)
    libraries:
      - name: syslib
        type: local
        locations:
          - "**/COPYBOOK"
      - name: syslib
        type: local
        locations:
          - "/COPYBOOK"              
      - name: syslib
        type: local
        locations:
          - "COPYBOOK"              `

I have the Z Open Editor extension installed.

I open the folder c:\Cobol in VSCode and click on the MYPGM.cbl file in the LHS pane. It opens the program and I can see the formatting and syntax highlighting etc. But I get a series of messages You opened a file with include files, but do not have a Property Group defined that specifies where to find them. Review the documentation and your settings or Zapp files. And a tonne of undeclared variables

Expected behavior

-I shouldn't get that message and should not have an issue with undeclared variables.

kristinochka commented 1 year ago

@mahadea You can check Z Open Editor log to see exactly why copybooks are not found. Here are direction how to view the log: https://ibm.github.io/zopeneditor-about/Docs/locating_local_client_logs.html#troubleshooting-using-log-files You can change the log level to "DEBUG" for most detailed oputput if "INFO" is not enough.

It's possible your zapp.yaml file is not formatted correctly, I cannot tell from your pasted text. Also, based on your example the subfolder should be called COPYBOOK.

mahadea commented 1 year ago

That was helpful. There was indeed an issue with zapp.yaml. Sorry that I didn't pay attention to how it was copy pasted into this window and thank you for not giving me a hard time about it. Dang those yaml files are finicky, almost as bad as JCL. Image 206 FWIW, I am attaching an image of the zapp.yaml file that finally worked for me