Hello I need help with my code. Basically i'd like to print a line with 3 fields 3 times on a line and then print the line 6 times with each line displaying different variables. Im using Net Express 5.1
Example:
DISC-NAME TOTALS
xxx xxxxxxxx 9999 xxx xxxxxxxx 9999 xxx xxxxxxxx 9999
xxx xxxxxxxx 9999 xxx xxxxxxxx 9999 xxx xxxxxxxx 9999
I want to print this fields 18 times in total on 6 lines because I have 18 different variables. I made a table for the DISC-NAME TOTALS and also for the printline. THis is my code.
01 WORKNG-AREA.
05 TABLE-SUB PIC 99 VALUE ZEROES.
01 DISC-TABLE-AREA.
05 FILLER PIC X(27) VALUE "01STAR VULCAN 1350".
05 FILLER PIC X(27) VALUE "02DX WEDGE 0899".
05 FILLER PIC X(27) VALUE "03NUKE ELITE-X 0899".
05 FILLER PIC X(27) VALUE "04P1 MANIAC P-LINE 0999".
05 FILLER PIC X(27) VALUE "05KATANA 0999".
05 FILLER PIC X(27) VALUE "06R-PRO WAHOO 1350".
05 FILLER PIC X(27) VALUE "07AVIAR YETI PRO 0899".
05 FILLER PIC X(27) VALUE "08ARCH ANGEL DX 1350".
05 FILLER PIC X(27) VALUE "09ASSASSIN EVOLUTION 0999".
05 FILLER PIC X(27) VALUE "10AVENGER PRO-D 1350".
05 FILLER PIC X(27) VALUE "11BANSHEE DX 0999".
05 FILLER PIC X(27) VALUE "12BOSS PRO 0899".
05 FILLER PIC X(27) VALUE "13BANGER GT PRO-D 1350".
05 FILLER PIC X(27) VALUE "14CROSSHAIR BASELINE 0999".
05 FILLER PIC X(27) VALUE "15DART DX 0899".
05 FILLER PIC X(27) VALUE "16FOCUS PRO-D 1350".
05 FILLER PIC X(27) VALUE "17JUJU SUPREME 0899".
05 FILLER PIC X(27) VALUE "18MAGIC (SOFT) S-SERIES1099".
01 DISC-TABLE REDEFINES DISC-TABLE-AREA.
05 DISC-DATA OCCURS 18 TIMES.
10 DISC-CODE PIC 99.
10 DISCNAME PIC X(21).
10 DISCPRICE PIC 99V99.
=====PRINTLINE
01 O-SALES-DETAILS.
05 SALES-DETAIL OCCURS 4 TIMES.
10 FILLER PIC XX VALUE SPACES.
10 O-GTDISCCODE1 PIC 99.
10 FILLER PIC XX VALUE SPACES.
10 O-GTDISCNAME1 PIC X(21).
10 FILLER PIC XX VALUE SPACES.
10 O-GTDISCSALES1 PIC $$,$$$.99.
10 FILLER PIC X(10) VALUE SPACES.
3000-TOTAL.
PERFORM 3100-GRANDTOTALS.
PERFORM 3200-DISCTOTALS
WRITE PRTLINE
FROM O-SALES-DETAILS
AFTER ADVANCING 4 LINE.
ADD 1 TO TABLE-SUB.
3200-DISCTOTALS.
MOVE 1 TO TABLE-SUB.
PERFORM 3210-CLR-DISCTOTAL
VARYING SUB FROM 1 BY 1
UNTIL SUB > 4.
3210-CLR-DISCTOTAL.
MOVE DISC-CODE(TABLE-SUB) TO O-GTDISCCODE1(SUB).
MOVE DISCNAME(TABLE-SUB) TO O-GTDISCNAME1(SUB).
MOVE C-DISCTOTSALES(TABLE-SUB) TO O-GTDISCSALES1(SUB).
ADD 1 TO TABLE-SUB.
This is how I want it to look like:
XX DISCNAME01 9999 XX DISCNAME02 9999 XX DISCNAME03 9999
XX DISCNAME04 9999 XX DISCNAME05 9999 XX DICSNAME06 9999
XX DISCNAME07 9999 XX DISCNAME08 9999 XX DISCNAME09 9999
XX DISCNAME10 9999 XX DISCNAME11 9999 XX DISCNAME12 9999
XX DISCNAME13 9999 XX DISCNAME14 9999 XX DISCNAME15 9999
XX DISCNAME16 9999 XX DISCNAME17 9999 XX DISCNAME18 9999
PLEASE HELP ME!