The MF group recently helped my with a "Resume Type Reporting" problem where I
was trying to report from three independent sets of data and display the three
different sets in three separate sections, stacked one on top of the other. The
example on the support site wasn't great, so here's a WebFOCUS version using the
CAR file that you can try. Using TABLEF is key to making this work, since "TABLEF does not merge, and therefore keeps the paths independent of each other."
DEFINE FILE CAR
CFLAG/A1 WITH CAR = 'A' ;
MFLAG/A1 WITH MODEL = 'B' ;
BFLAG/A1 WITH BODYTYPE = 'C' ;
END
-RUN
-*** First independent path:
TABLE FILE CAR
PRINT CAR CFLAG
AND COMPUTE CARCNT/I6 = IF CAR NE LAST CAR THEN 1 ELSE CARCNT + 1 ;
BY COUNTRY
ON TABLE HOLD AS GOTCAR
END
-RUN
-*** Second independent path:
TABLE FILE CAR
PRINT MODEL MFLAG
AND COMPUTE MODCNT/I6 = IF MODEL NE LAST MODEL THEN 1 ELSE MODCNT + 1 ;
BY COUNTRY
ON TABLE HOLD AS GOTMOD
END
-RUN
-*** Third independent path:
TABLE FILE CAR
PRINT BODYTYPE BFLAG
AND COMPUTE BODCNT/I6 = IF BODYTYPE NE LAST BODYTYPE THEN 1 ELSE BODCNT + 1 ;
BY COUNTRY
ON TABLE HOLD AS GOTBOD
END
-RUN
-*** Host file:
TABLE FILE CAR
PRINT COUNTRY BY COUNTRY
ON TABLE HOLD AS GOTCOUN
END
-RUN
JOIN CLEAR *
JOIN COUNTRY IN GOTCOUN TO ALL COUNTRY IN GOTCAR AS J1
JOIN COUNTRY IN GOTCOUN TO ALL COUNTRY IN GOTMOD AS J2
JOIN COUNTRY IN GOTCOUN TO ALL COUNTRY IN GOTBOD AS J3
END
-RUN
TABLEF FILE GOTCOUN
PRINT
CAR CFLAG CARCNT
MODEL MFLAG MODCNT
BODYTYPE BFLAG BODCNT
BY COUNTRY
ON TABLE HOLD
END
-RUN
DEFINE FILE HOLD
LINE/A80 = IF CFLAG EQ 'A' THEN CAR ELSE
IF MFLAG EQ 'B' THEN MODEL ELSE BODYTYPE ;
FLAG/A1 = IF CFLAG EQ 'A' THEN 'A' ELSE
IF MFLAG EQ 'B' THEN 'B' ELSE 'C' ;
COUNTER/I6 = IF CFLAG EQ 'A' THEN CARCNT ELSE
IF MFLAG EQ 'B' THEN MODCNT ELSE BODCNT ;
END
-RUN
TABLE FILE HOLD
HEADING CENTER
"RESUME TYPE REPORTING EXAMPLE"
" "
"<COUNTRY"
" "
PRINT LINE AS ' '
BY COUNTRY NOPRINT PAGE-BREAK
BY FLAG NOPRINT UNDER-LINE
BY COUNTER NOPRINT
ON FLAG SUBHEAD
"Car"
" "
WHEN FLAG EQ 'A'
ON FLAG SUBHEAD
"Model"
" "
WHEN FLAG EQ 'B'
ON FLAG SUBHEAD
"Bodytype"
" "
WHEN FLAG EQ 'C'
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
UNITS=CM, LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000,
TOPMARGIN=0.100000, BOTTOMMARGIN=0.250000 ,$
TYPE=REPORT, FOCEXEC=NONE, FONT=ARIAL, SIZE=9, COLOR=BLACK, BACKCOLOR=NONE,
STYLE=NORMAL, GRID=OFF, SQUEEZE=ON, ORIENTATION=PORTRAIT, PAGESIZE=LETTER ,$
-*
TYPE=DATA ,GRID=OFF ,$
-*
TYPE=HEADING ,STYLE=BOLD ,SIZE=12 ,COLOR=NAVY ,$
TYPE=HEADING ,LINE=5 ,SIZE=14 ,$
TYPE=HEADING ,LINE=7 ,SIZE=10 ,STYLE=BOLD ,$
TYPE=HEADING ,LINE=8 ,SIZE=10 ,STYLE=NORMAL ,$
TYPE=HEADING ,LINE=9 ,SIZE=12 ,STYLE=BOLD+UNDERLINE ,COLOR=RED ,$
-*
TYPE=SUBHEAD ,STYLE=BOLD+ITALIC ,SIZE=9 ,COLOR=NAVY ,$
TYPE=SUBHEAD ,LINE=3 ,STYLE=BOLD+UNDERLINE ,SIZE=9 ,COLOR=NAVY ,$
TYPE=TABHEADING ,STYLE=BOLD+ITALIC ,SIZE=9 ,$
-*
TYPE=SUBFOOT ,BY=FLAG ,LINE=1 ,STYLE=BOLD+UNDERLINE ,SIZE=12 ,COLOR=NAVY ,$
TYPE=SUBFOOT ,LINE=2 ,STYLE=BOLD+UNDERLINE ,SIZE=10 ,COLOR=NAVY ,$
TYPE=SUBFOOT ,LINE=4 ,STYLE=NORMAL ,SIZE=9 ,COLOR=BLACK ,$
TYPE=SUBFOOT ,LINE=5 ,STYLE=BOLD ,$
-*
TYPE=TABFOOTING ,STYLE=BOLD+ITALIC ,SIZE=9 ,$
TYPE=SUBTOTAL ,STYLE=BOLD+ITALIC ,SIZE=9 ,COLOR=NAVY ,$
TYPE=GRANDTOTAL ,STYLE=BOLD+ITALIC ,SIZE=9 ,COLOR=NAVY ,$
TYPE=FOOTING ,SIZE=8 ,COLOR=RED ,$
ENDSTYLE
END
-RUN
*** The counter fields are used so that every iteration from CAR, MODEL, and
BODYTYPE is captured.