Legend Report



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

Re: Legend Report

Postby fbryant2010 » Thu Oct 14, 2010 7:39 pm

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

Re: Legend Report

Postby NicC » Thu Oct 14, 2010 9:28 pm

Yes, of course your print line can be an array. That is what we have been saying.
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: Legend Report

Postby fbryant2010 » Thu Oct 14, 2010 9:55 pm

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

Re: Legend Report

Postby NicC » Thu Oct 14, 2010 10:51 pm

isn't it? prove it to us. And what is wrong with using legend-code(sub) etc?
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: Legend Report

Postby dick scherrer » Fri Oct 15, 2010 12:05 am

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. . .
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: Legend Report

Postby fbryant2010 » Fri Oct 15, 2010 12:18 am

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

Re: Legend Report

Postby dick scherrer » Fri Oct 15, 2010 12:40 am

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).
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: Legend Report

Postby fbryant2010 » Fri Oct 15, 2010 6:01 pm

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

Re: Legend Report

Postby enrico-sorichetti » Fri Oct 15, 2010 6:04 pm

LEGEND-CODE(SUB)

what are You trying to achieve with that declaration?
review the cobol manual for the construct allowed in the declaratives
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Legend Report

Postby fbryant2010 » Fri Oct 15, 2010 6:52 pm

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

PreviousNext

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post