Page 1 of 1

IGYPS2013-E

PostPosted: Fri Oct 08, 2010 10:25 pm
by fbryant2010
IGYPS2013-E Not enough subscripts or indices were specified for "WS-VVD-CODE"
IGYPS2013-E Not enough subscripts or indices were specified for "WS-VVD-DESC"

IGYPS2121-S "SUB3" was not defined as a data-name.

What is my problem with the following code?

01 WS-SUB.
05 WS-VVD-SUB PIC S9(04) COMP-3 VALUE +0.
05 WS-SUB1 PIC S9(04) COMP-3 VALUE +0.
05 WS-SUB2 PIC S9(04) COMP-3 VALUE +0.

01 WS-VVD-TABLES.
05 WS-VVD-ENTRIES OCCURS 11 TIMES.
10 WS-VVD-CODE PIC X(03).
10 WS-VVD-DESC PIC X(30).

Re: IGYPS2013-E

PostPosted: Fri Oct 08, 2010 11:41 pm
by Robert Sample
There's absolutely nothing wrong with the posted code. The error messages appear to be from PROCEDURE DIVISION statements. Since you did not post any PROCEDURE DIVISION statements, we cannot comment about the correctness (or not) of them.

Re: IGYPS2013-E

PostPosted: Fri Oct 08, 2010 11:41 pm
by NicC
Your error says SUB3 is not defined and you do not show it being defined - only 1 and 2. That for starters.

Re: IGYPS2013-E

PostPosted: Sat Oct 09, 2010 1:49 am
by fbryant2010
I have a table loaded and I want to create a legend on a report. How do I get this table moved to a print record? The legend will contain the code with the matching description.

 01 WS-VVD-TABLES                                         
 02 WS-VVD-ENTRIES                                         
 03 WS-VVD-CODE                                           
 SUB(1)                   'CIG'                           
 SUB(2)                   'CTL'                           
 SUB(3)                   'EGG'                           
 SUB(4)                   'FEN'                           
 SUB(5)                   'PAC'                           
 SUB(6)                   'PDL'                           
 SUB(7)                   'PTL'                           
 SUB(8)                   'SBL'                           
 SUB(9)                   'STI'                           
 SUB(10)                  'STP'                           
 SUB(11)                  'TOB'                           
 03 WS-VVD-DESC                                           
 SUB(1)                   'Cigarettes                    '
 SUB(2)                   'Cigarette & Tobacco License # '
 SUB(3)                   'Egg License #                 '
 SUB(4)                   'FederalEmployerIdentification#'
 SUB(5)                   'Perishable Ag Commod Act #    '
 SUB(6)                   'Plant Dealer License #        '
 SUB(7)                   'Privilege Tax Lic #           '
 SUB(8)                   'State Business License #      '
 SUB(9)                   'State Tax Id #                '
 SUB(10)                  'Sales Tax Permit #            '
 SUB(11)                  'Tobacco License #             '

Re: IGYPS2013-E

PostPosted: Sat Oct 09, 2010 1:57 am
by dick scherrer
Hello,

Write a loop to start at the beginning of the arrays and move the "code" and the "description" to an output area, then write the output.

Continue thru this loop until the end of the table is reached. I'd suggest adding a "last code" of '999' so the end of the table can easily be tested. When the loop reaches code 999, the legend is done.

Re: IGYPS2013-E

PostPosted: Sat Oct 09, 2010 2:05 am
by fbryant2010
At what point should I begin the loop? What would a sample code look like?

Thanks!

Re: IGYPS2013-E

PostPosted: Sat Oct 09, 2010 3:31 am
by dick scherrer
Hello,

You need to build the code - we will help when there are problems/questions.

You need something like:
   move 1 to the subscript
loop
   move code(s) to out-code
   move desc(s) to out-desc
   write output
   increment subscript
   if code(s) not = '999' go to loop
 ... whatever is next


We will help but we won't actually do the assignment for you. Actually, if someone posts the complete coded solution, it will be deleted.

Re: IGYPS2013-E

PostPosted: Mon Oct 11, 2010 7:53 pm
by fbryant2010
It was a great help. Thanks! I appreciate it.

Re: IGYPS2013-E

PostPosted: Mon Oct 11, 2010 10:02 pm
by dick scherrer
You're welcome - good luck :)

d