Page 2 of 3

Re: Legend Report

PostPosted: Thu Oct 14, 2010 7:39 pm
by fbryant2010
Can the legend format below be done? Three arrays across one line.

TAX CODES AND THEIR MEANING
----------------------------
CIG = Cigarettes CTL = Cigarette & Tobacco License # EGG = Egg License #
FEN = FederalEmployerIdentification# PAC = Perishable Ag Commod Act # PDL = Plant Dealer License #
PTL = Privilege Tax Lic # SBL = State Business License # STI = State Tax Id #
STP = Sales Tax Permit # TOB = Tobacco License #

Re: Legend Report

PostPosted: Thu Oct 14, 2010 9:28 pm
by NicC
Yes, of course your print line can be an array. That is what we have been saying.

Re: Legend Report

PostPosted: Thu Oct 14, 2010 9:55 pm
by fbryant2010
This is not working. The table has 11 entries.

PERFORM TEST BEFORE VARYING WS-VVD-SUB FROM 1 BY 1
UNTIL WS-VVD-CODE (WS-VVD-SUB) = '999'
INITIALIZE LEGEND-LINE5
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE1
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC1
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE2
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC2
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE3
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC3
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE4
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC4
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE5
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC5
ADD +1 TO WS-VVD-SUB
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE6
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC6
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE7
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC7
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE8
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC8
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE9
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC9
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE10
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC10
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE11
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC11
ADD +1 TO WS-VVD-SUB
MOVE WS-VVD-CODE(WS-VVD-SUB) TO LEGEND-CODE12
MOVE WS-VVD-DESC(WS-VVD-SUB) TO LEGEND-DESC12
ADD +1 TO WS-VVD-SUB
END-PERFORM

Re: Legend Report

PostPosted: Thu Oct 14, 2010 10:51 pm
by NicC
isn't it? prove it to us. And what is wrong with using legend-code(sub) etc?

Re: Legend Report

PostPosted: Fri Oct 15, 2010 12:05 am
by dick scherrer
Hello,

In the first post for this topic you say:
The legend is coming from a DB2 table.


If the legend info is being retrieved from a db2 table, why are all of the codes/descs shown as literals?

Read the row from the table and move it to an array.
COntinue until all needed rows have been stored in the array.

When processing is done, start back at the beginning of the array print each code/desc from a common "print line".

It looks like you are adding unnecessary difficulty. . .

Re: Legend Report

PostPosted: Fri Oct 15, 2010 12:18 am
by fbryant2010
How do I print 3 arrays on one print line? I need to print 3 codes/desc on each print line. Even as we speak, the user has added additional codes. There are actually 13 rows being fetched now. At the beginning of the day there were 11.

Re: Legend Report

PostPosted: Fri Oct 15, 2010 12:40 am
by dick scherrer
Hello,

There are actually 13 rows being fetched now. At the beginning of the day there were 11.
Which is why i jumped to 100. . . ;)

How do I print 3 arrays on one print line? I need to print 3 codes/desc on each print line
Then the print line becomes another array and you move from "where you are" in the legend array to the "next" print item. Once 3 have been moved to the print array, print the line and reset to the beginning of the print array.

When the last row has been processed, print the last print line that was being built (unless it has no data).

Re: Legend Report

PostPosted: Fri Oct 15, 2010 6:01 pm
by fbryant2010
What is wrong with this print line? Complier does not like it. Can I even do this?
It does not like the '(sub)'


IGYDS1089-S "(" was invalid. Scanning was resumed at the next area "A" item, level-number, or the start of the next clause.

05 LEGEND-LINE2.
10 LEGEND-CODE(SUB) PIC X(3).
10 FILLER PIC X(3)
VALUE ' = '.
10 LEGEND-DESC(SUB) PIC X(30).
10 FILLER PIC X(3)
VALUE ' '.
10 LEGEND-CODE(SUB) PIC X(3).
10 FILLER PIC X(3)
VALUE ' = '.
10 LEGEND-DESC(SUB) PIC X(30).
10 FILLER PIC X(3)
VALUE ' '.
10 LEGEND-CODE(SUB) PIC X(3).
10 FILLER PIC X(3)
VALUE ' = '.
10 LEGEND-DESC(SUB) PIC X(30).
10 FILLER PIC X(3)

Re: Legend Report

PostPosted: Fri Oct 15, 2010 6:04 pm
by enrico-sorichetti
LEGEND-CODE(SUB)

what are You trying to achieve with that declaration?
review the cobol manual for the construct allowed in the declaratives

Re: Legend Report

PostPosted: Fri Oct 15, 2010 6:52 pm
by fbryant2010
I am trying to:

MOVE SQL-VVD-CODE TO WS-VVD-CODE (WS-VVD-SUB)
LEGEND-CODE (SUB)
MOVE SQL-VVD-DESC TO WS-VVD-DESC (WS-VVD-SUB)
LEGEND-DESC (SUB)