Hi:
You may have some other issues with your code. For example, SALES is being read as character, which may give you trouble if you are trying to sum a character variable for the height of the bars. Using SUMVAR=SALES, with SALES as a character variable, I would expect you to get this error:
[pre]
ERROR: Variable sales in list does not match type prescribed for this list.
[/pre]
Also, I only see one company's data??? with the variable CLOSE having the values "B DEPT", "A DEPT", etc. It looks to me like CLOSE is the variable you are using for Department values? But it also looks to me like PERSON starts in position 8, not position 12 and that GRP starts in position 10 and SALES starts in position 12, not 16.
So your problems may partly be caused by reading the input data incorrectly and/or reading the data as character instead of numeric. In the sample data below, I put position numbers above your data to show how I calculated the position numbers. (The position numbers are specified with the '@' in the INPUT statement.)
[pre]
.........1111
1234567890123
B DEPT 1 A 20
A DEPT 1 A 10
P DEPT 2 A 30
[/pre]
If you want to create a "subgroup" chart, then you may not want to use the macro program as it is coded. First, the macro program uses PATTERNID=MIDPOINT -- which is how chocolate always stays brown and strawberry always stays pink. You will probably want the default of PATTERNID=SUBGROUP and before you try to modify that macro program, it would be good to understand how the fills will work for the subgroups -without- a macro program being involved. Normally, every subgroup (every person or every department) -will- get a different color automatically. Since a legend will identify which color (or pattern) corresponds to which subgroup value, it is usually pretty easy to distinguish which subgroups make up a bar.
If you have issues with reading the data or coding PROC GCHART or controlling fill colors or figuring out how a different macro program might be used to help you, you may want to work with Tech Support on this, as they can look at all your real data and your code and help you come to the best solution -- whether it's a macro solution or not.
cynthia