Skip to main content

Json compile error!

  • March 9, 2020
  • 10 replies
  • 0 views

Claude Greiner

i use a demo json Cobol program found by mf

With netexpress 5.x no error by compiling, with visual Cobol 5.x following Errors:

json generate json-doc from Person Count in c1             *> (line 68)

Name of salary is 'income'                              

suppress NS-num *> for security                                     *> (line 70) 

Typ  *> for brevity

COBCH0012 Operand json is not declared                    --> Line 68
COBCH0058 Not a Report Name or a Report Group    --> Line 68 
COBCH0301 Unrecognized verb                                  --> line 70

 

10 replies

Chris Glazier
Forum|alt.badge.img+2

i use a demo json Cobol program found by mf

With netexpress 5.x no error by compiling, with visual Cobol 5.x following Errors:

json generate json-doc from Person Count in c1             *> (line 68)

Name of salary is 'income'                              

suppress NS-num *> for security                                     *> (line 70) 

Typ  *> for brevity

COBCH0012 Operand json is not declared                    --> Line 68
COBCH0058 Not a Report Name or a Report Group    --> Line 68 
COBCH0301 Unrecognized verb                                  --> line 70

 

I believe you might mean that the JSON GENERATE statement fails in Net Express whereas it works in Visual COBOL?

The JSON Generate statement is new in Visual COBOL and was not supported in the Net Express product.

The program that you attached compiles fine for me in Visual COBOL 5.0.


Claude Greiner
  • Author
  • Participating Frequently
  • March 9, 2020

I believe you might mean that the JSON GENERATE statement fails in Net Express whereas it works in Visual COBOL?

The JSON Generate statement is new in Visual COBOL and was not supported in the Net Express product.

The program that you attached compiles fine for me in Visual COBOL 5.0.

Sorry Chris, but in this example the are many Errors, they must be corrected before running!

- json-Status is not declared

- any fields are duplicate and have not the term "of" (Age, Name, Country and other)

And i have the newest VS2019 Update 5 and the newest VC 5.0 Update 6 and i become the same Errors!

Do you use a other directive for json?

 


Chris Glazier
Forum|alt.badge.img+2

Sorry Chris, but in this example the are many Errors, they must be corrected before running!

- json-Status is not declared

- any fields are duplicate and have not the term "of" (Age, Name, Country and other)

And i have the newest VS2019 Update 5 and the newest VC 5.0 Update 6 and i become the same Errors!

Do you use a other directive for json?

 

I can compile this in either a native code console or a .NET console project with default settings or from the command line with default settings with no errors.

Perhaps you are setting the DIALECT directive to change this to an older dialect that doesn't support this?

What are your directives and how are you compiling?


Claude Greiner
  • Author
  • Participating Frequently
  • March 9, 2020

I can compile this in either a native code console or a .NET console project with default settings or from the command line with default settings with no errors.

Perhaps you are setting the DIALECT directive to change this to an older dialect that doesn't support this?

What are your directives and how are you compiling?

Chris, in release mode successfull with my changes, but in debug mode the Errors are the same as indicated in my first message!

Chris Glazier
Forum|alt.badge.img+2
Chris, in release mode successfull with my changes, but in debug mode the Errors are the same as indicated in my first message!

It sounds like you may have changed the directives being used in your DEBUG build.

Look at the COBOL tab on the Properties page. What is the current setting of Dialect? 

You can also compile with the SETTINGS directive on and create a list file that contains at the top all of the directives being picked up.

 


Claude Greiner
  • Author
  • Participating Frequently
  • March 9, 2020
Chris, in release mode successfull with my changes, but in debug mode the Errors are the same as indicated in my first message!

here the corrected example with error in debug compile mode


Claude Greiner
  • Author
  • Participating Frequently
  • March 9, 2020

here the corrected example with error in debug compile mode

i use this directive converted from netexpress 5.x

IDXFORMAT"4" FILETYPE"4" CALLFH"EXTFH"  OPT(1) sourcetabstop(8) mflevel"15" REMOVE"OBJECT-REFERENCE"

and this in the source program.

i have send a json0000.zip

 


Claude Greiner
  • Author
  • Participating Frequently
  • March 9, 2020

i use this directive converted from netexpress 5.x

IDXFORMAT"4" FILETYPE"4" CALLFH"EXTFH"  OPT(1) sourcetabstop(8) mflevel"15" REMOVE"OBJECT-REFERENCE"

and this in the source program.

i have send a json0000.zip

 

the dialect is "Micro Focus"

 


Chris Glazier
Forum|alt.badge.img+2

the dialect is "Micro Focus"

 

Remove the mflevel"15" directive and it will compile ok.

The current mflevel in Visual COBOL is "20".

mflevel"15" sets the compiler to behave like the following product

  • Net Express 6.0 SP1; Net Express 5.1 WS5
  • Visual COBOL R1

These products did not include support for the JSON statements.


Claude Greiner
  • Author
  • Participating Frequently
  • March 11, 2020

Remove the mflevel"15" directive and it will compile ok.

The current mflevel in Visual COBOL is "20".

mflevel"15" sets the compiler to behave like the following product

  • Net Express 6.0 SP1; Net Express 5.1 WS5
  • Visual COBOL R1

These products did not include support for the JSON statements.

Thanks, Chris!