Skip to main content

COBCH0217S Preceding item at this level has zero length

  • March 25, 2020
  • 3 replies
  • 0 views

Hi,

my (maybe 25 years old) Copy starts with

01 L-VD-Daten sign leading separate.
02 MOVE-LVDDATEN.

03 Gesamt.
05 VNR PIC S9(8).

...

Trying to compile it in Visual Cobol 5 CobolCopyBook-Project/COBOL-JVM-Poject I am getting 'COBCH0217S Preceding item at this level has zero length' .

Is there maybe any directive to avoid this ?

Sincerely,

Herbert

 

3 replies

Claude Greiner
  • Participating Frequently
  • March 25, 2020

Hi,

my (maybe 25 years old) Copy starts with

01 L-VD-Daten sign leading separate.
02 MOVE-LVDDATEN.

03 Gesamt.
05 VNR PIC S9(8).

...

Trying to compile it in Visual Cobol 5 CobolCopyBook-Project/COBOL-JVM-Poject I am getting 'COBCH0217S Preceding item at this level has zero length' .

Is there maybe any directive to avoid this ?

Sincerely,

Herbert

 

Hi Herbert,

This can't work with visual Cobol 5.x
do you have the rm directive? (for RyanMac Compiler)

Use this, that will be better and must works:

01 L-VD-Daten.
    02 MOVE-LVDDATEN.
         03 Gesamt.
              05 VNR PIC S9(8)  sign leading separate.

Why you want to have the sign separate? leading or trealing!

I hope this will help you.

Claude Greiner

 

 


Hi Herbert,

This can't work with visual Cobol 5.x
do you have the rm directive? (for RyanMac Compiler)

Use this, that will be better and must works:

01 L-VD-Daten.
    02 MOVE-LVDDATEN.
         03 Gesamt.
              05 VNR PIC S9(8)  sign leading separate.

Why you want to have the sign separate? leading or trealing!

I hope this will help you.

Claude Greiner

 

 

Specifying options like SIGN IS LEADING SEPARATE at the 01 level is part of standard ANSI COBOL, and has the effect that all numeric items within the group have the specified sign format.

I found that the code did compile fine with VC 5.0, so I suspect that we are missing some context.  Can you try compiling just the following as a separate program?

 

01 L-VD-Daten sign leading separate.
02 MOVE-LVDDATEN.
03 Gesamt.
05 VNR PIC S9(8).

      move 3 to vnr

      display vnr

 

It should compile fine, and when you run it you should see the following display:

 

00000003

 

If, as I suspect, this all works, then I think you will have to give us a bit more of the program that's showing the problem.

 


Hi,

my (maybe 25 years old) Copy starts with

01 L-VD-Daten sign leading separate.
02 MOVE-LVDDATEN.

03 Gesamt.
05 VNR PIC S9(8).

...

Trying to compile it in Visual Cobol 5 CobolCopyBook-Project/COBOL-JVM-Poject I am getting 'COBCH0217S Preceding item at this level has zero length' .

Is there maybe any directive to avoid this ?

Sincerely,

Herbert

 

Thanks for your rapid answers !

I created new Copybook-JVM-Java projects, now it works fine ...

Maybe some difference in the compiler configuration ?!

 

Herbert