I am trying to make a report which will combine all similar field into one fieldThis message has been edited. Last edited by: Kerry,
7.6. / Win 7 / Excel
August 20, 2009, 03:45 PM
YKK
sorry, incomplete, i continue.
In file STRTST03 there is 10 records containing data for year 2008 ( Year3 field ) In file STRTST04 there is 10 records containing data for year 2009 ( Year4 field ) In file STRTST05 there is 3 records containing data for year 2008 ( Year5 field ) In file STRTST06 there is 3 records containing data for year 2009 ( Year6 field )
I am trying to create a report to show 26 record with data as
SET ASNAMES = ON
-SET &CNTR = 3;
-REPEAT GET_DATA 5 TIMES
TABLE FILE SRTST0&CNTR
PRINT
TypeLbl&CNTR AS 'TYPE_LBL'
DivLbl&CNTR AS 'DIV_LBL'
Sales&CNTR AS 'SALES'
BY JoinLbl0&CNTR AS 'KEY_COL'
BY Year&CNTR AS 'YEAR'
ON TABLE HOLD AS HOLD&CNTR
END
-RUN
-SET &CNTR = &CNTR + 1;
-IF &CNTR GT 7 GOTO DONE;
-GET_DATA
-DONE
TABLE FILE HOLD3
PRINT
TYPE_LBL
DIV_LBL
SALES
BY KEY_COL
BY YEAR
ON TABLE HOLD AS FINAL
MORE
FILE HOLD4
MORE
FILE HOLD5
MORE
FILE HOLD6
MORE
FILE HOLD7
END
-RUN
TABLE FILE FINAL
PRINT
TYPE_LBL
DIV_LBL
SALES
BY KEY_COL
BY YEAR
END
-EXIT
Here's another idea. Since the formats for the four files are the same, use a single master and the USE statement to 'concatenate' the four FOCUS files to that master.
Ginny, I would have suggested that if all the column names were the same.
If programmers create FOCUS DB's like above, instead of creating them with the same column names and different file names, then, the code above, or something similar, is my thought.
Of course, creating "another" MFD with common names will work also.