Skip to main content

[Migrated content. Thread originally posted on 17 May 2005]

AcuBench generates this working storage code to hold the contents of a combo box:

01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS 9 TIMES
INDEXED SCR-LUSHIPTERM-Cm-1-Container-Idx.
77 SCR-LUSHIPTERM-Cm-1-Value PIC X(12).

What is the purpose of the 78 level item? I can see it holds the number of entries in the array but the redefines' occurs handles the number of entries as well. The 78 level item is not referenced anywhere in the generated procedure code. I have deleted the 78 level item without any apparent effect on execution.

Is there some purpose I'm missing? The item's placement in the group hierarchy is also puzzling.

Regards

Vins Nash

[Migrated content. Thread originally posted on 17 May 2005]

AcuBench generates this working storage code to hold the contents of a combo box:

01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS 9 TIMES
INDEXED SCR-LUSHIPTERM-Cm-1-Container-Idx.
77 SCR-LUSHIPTERM-Cm-1-Value PIC X(12).

What is the purpose of the 78 level item? I can see it holds the number of entries in the array but the redefines' occurs handles the number of entries as well. The 78 level item is not referenced anywhere in the generated procedure code. I have deleted the 78 level item without any apparent effect on execution.

Is there some purpose I'm missing? The item's placement in the group hierarchy is also puzzling.

Regards

Vins Nash
Looks to me like some poorly generated code by acubench. Have you contacted support?

[Migrated content. Thread originally posted on 17 May 2005]

AcuBench generates this working storage code to hold the contents of a combo box:

01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS 9 TIMES
INDEXED SCR-LUSHIPTERM-Cm-1-Container-Idx.
77 SCR-LUSHIPTERM-Cm-1-Value PIC X(12).

What is the purpose of the 78 level item? I can see it holds the number of entries in the array but the redefines' occurs handles the number of entries as well. The 78 level item is not referenced anywhere in the generated procedure code. I have deleted the 78 level item without any apparent effect on execution.

Is there some purpose I'm missing? The item's placement in the group hierarchy is also puzzling.

Regards

Vins Nash
I did ask support. But the reply was that it contains the number of entries in the array which we already know.

Thanks

Vins Nash

[Migrated content. Thread originally posted on 17 May 2005]

AcuBench generates this working storage code to hold the contents of a combo box:

01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS 9 TIMES
INDEXED SCR-LUSHIPTERM-Cm-1-Container-Idx.
77 SCR-LUSHIPTERM-Cm-1-Value PIC X(12).

What is the purpose of the 78 level item? I can see it holds the number of entries in the array but the redefines' occurs handles the number of entries as well. The 78 level item is not referenced anywhere in the generated procedure code. I have deleted the 78 level item without any apparent effect on execution.

Is there some purpose I'm missing? The item's placement in the group hierarchy is also puzzling.

Regards

Vins Nash
What I typically do when I structure things this way is use the constant wherever I need to define the max occurs items, for instance in WS:

78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS SCR-LUSHIPTERM-Cm-1-Container-Num TIMES
INDEXED BY SCR-LUSHIPTERM-Cm-1-Container-Idx.

And then in my procedure division, when I want to iterate through the SCR-LUSHIPTERM-Cm-1-Container items, I do something like this:
PERFORM VARYING SCR-LUSHIPTERM-Cm-1-Container-Idx
FROM 1 BY 1
UNTIL SCR-LUSHIPTERM-Cm-1-Container-Idx >
SCR-LUSHIPTERM-Cm-1-Container-Num
|do some logic with reference to SCR-LUSHIPTERM-Cm-1-Container(SCR-LUSHIPTERM-Cm-1-Container-Idx)
END-PERFORM.

This way when the max items(occurs) changes later I only have to change it one place in Working storage, and everything remains consistent.

[Migrated content. Thread originally posted on 17 May 2005]

AcuBench generates this working storage code to hold the contents of a combo box:

01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS 9 TIMES
INDEXED SCR-LUSHIPTERM-Cm-1-Container-Idx.
77 SCR-LUSHIPTERM-Cm-1-Value PIC X(12).

What is the purpose of the 78 level item? I can see it holds the number of entries in the array but the redefines' occurs handles the number of entries as well. The 78 level item is not referenced anywhere in the generated procedure code. I have deleted the 78 level item without any apparent effect on execution.

Is there some purpose I'm missing? The item's placement in the group hierarchy is also puzzling.

Regards

Vins Nash
What I typically do when I structure things this way is use the constant wherever I need to define the max occurs items, for instance in WS:

78 SCR-LUSHIPTERM-Cm-1-Container-Num VALUE IS 9.
01 .
03 SCR-LUSHIPTERM-Cm-1-Container-Item.
05 PIC X(12)
VALUE IS "1 COLLECT".
05 PIC X(12)
VALUE IS "2 PPD & CHG".
05 PIC X(12)
VALUE IS "3 PREPAID".
05 PIC X(12)
VALUE IS "4 WILL CALL".
05 PIC X(12)
VALUE IS "5 COUNTER".
05 PIC X(12)
VALUE IS "6".
05 PIC X(12)
VALUE IS "7".
05 PIC X(12)
VALUE IS "8".
05 PIC X(12)
VALUE IS "9".
03 SCR-LUSHIPTERM-Cm-1-Container REDEFINES
SCR-LUSHIPTERM-Cm-1-Container-Item PIC X(12)
OCCURS SCR-LUSHIPTERM-Cm-1-Container-Num TIMES
INDEXED BY SCR-LUSHIPTERM-Cm-1-Container-Idx.

And then in my procedure division, when I want to iterate through the SCR-LUSHIPTERM-Cm-1-Container items, I do something like this:
PERFORM VARYING SCR-LUSHIPTERM-Cm-1-Container-Idx
FROM 1 BY 1
UNTIL SCR-LUSHIPTERM-Cm-1-Container-Idx >
SCR-LUSHIPTERM-Cm-1-Container-Num
|do some logic with reference to SCR-LUSHIPTERM-Cm-1-Container(SCR-LUSHIPTERM-Cm-1-Container-Idx)
END-PERFORM.

This way when the max items(occurs) changes later I only have to change it one place in Working storage, and everything remains consistent.