IGYPS2013-E



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

IGYPS2013-E

Postby fbryant2010 » Fri Oct 08, 2010 10:25 pm

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).
fbryant2010
 
Posts: 20
Joined: Fri Oct 08, 2010 9:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IGYPS2013-E

Postby Robert Sample » Fri Oct 08, 2010 11:41 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: IGYPS2013-E

Postby NicC » Fri Oct 08, 2010 11:41 pm

Your error says SUB3 is not defined and you do not show it being defined - only 1 and 2. That for starters.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: IGYPS2013-E

Postby fbryant2010 » Sat Oct 09, 2010 1:49 am

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 #             '
fbryant2010
 
Posts: 20
Joined: Fri Oct 08, 2010 9:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IGYPS2013-E

Postby dick scherrer » Sat Oct 09, 2010 1:57 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: IGYPS2013-E

Postby fbryant2010 » Sat Oct 09, 2010 2:05 am

At what point should I begin the loop? What would a sample code look like?

Thanks!
fbryant2010
 
Posts: 20
Joined: Fri Oct 08, 2010 9:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IGYPS2013-E

Postby dick scherrer » Sat Oct 09, 2010 3:31 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: IGYPS2013-E

Postby fbryant2010 » Mon Oct 11, 2010 7:53 pm

It was a great help. Thanks! I appreciate it.
fbryant2010
 
Posts: 20
Joined: Fri Oct 08, 2010 9:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IGYPS2013-E

Postby dick scherrer » Mon Oct 11, 2010 10:02 pm

You're welcome - good luck :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol