We help IT Professionals succeed at work.
Get Started

Catalog Index

Jeff asked
Last Modified: 2016-02-11
Tools: DB2 on iSeries and VBA in Bartender barcode software

I am creating catalogs for customers using data gathered via DB2 SQL and Bartender for printing. These items are grouped by category and I need an index of the categories to put in front of these catalogs.

My Data file:

ITEM         Description              Cost          Category
012345,    My first item,           9.99,         Cat1
012356,    My second item,     8.99,         Cat1
123456,    My third item,         9.99,         Cat2
112345,    My fourth item,           9.99,         Cat3
222356,    My fifth item,     8.99,         Cat3
333456,    My sixth item,         9.99,         Cat3
and so on...

There are 13 records per page.

So I'm thinking something along the lines of:


Set PageCount = 1
Set CatName = ItmCat
RecCount increments by 1 for every record
PageCount increments by 1 everytime RecCount = 14.
Reset RecCount after hitting 14
IF ItmCat <> CatName
Write PageCount  and ItmCat to file every time ItmCat changes
Loop back to Set

So that my end result is a file to print my index:

Pg 1  Cat1
Pg 2 Cat 2
Pg 6 Cat8
and so on....
Watch Question
Expert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE