OpenCOBOL Complex ODO (OCCURS DEPENDING ON) -


i new cobol(and opencobol) , question "complex-odo" (occurs...depending on) in opencobol.

i used 1.0 on following code

......

01  w-ptdo-proc-tbl.        05  w-ptdo-proc-entry occurs 0 450 times              depending on w-ptdo-proc-max              indexed w-ptdo-proc-indx.            10 w-ptdo-proc-apc        pic x(05).            10 w-ptdo-proc-lnsub      pic s9(07)   comp-3.            10 w-ptdo-proc-key.                15 w-ptdo-proc-wa-offset  pic 9(08)v99.                15 w-ptdo-proc-units      pic 9(09).            10 w-ptdo-proc-device-cnt pic 9(03).            10 w-ptdo-proc-darray occurs 0 450 times                 depending on w-ptdo-darray-max                 indexed w-ptdo-darray-indx.                15  w-ptdo-proc-dhcpcs pic x(05).            10 w-ptdo-darray-size     pic 9(03).            10 w-ptdo-proc-tot-dchrgs pic 9(10)v99.            10 w-ptdo-proc-tot-dunits pic 9(05).            10 w-ptdo-proc-used       pic x(01). 

......

and cobc returns error msg:

error: 'w-ptdo-proc-entry' cannot have occurs clause due 'w-ptdo-proc-darray'

and above error msg issued field.c found comment /* data item contains occurs depending clause shall not subordinate data item has occurs clause */

is there anyway make opencobol support "complex-odo"?

my above code snippet, "occurs depending" nested under higher level "occurs" clause, seems well-defined "complex-odo" according appendix of ibm's cobol programming guide.

thank you,

billy rong

you cannot have variable length array (occurs depending on) inside array!

the processing required complex. if length of inner array item allowed vary, possible way calculate start of nth entry of outer array sequentially access each inner member 1 n , use depending on count work out length, and, hence start of next array entry.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -