Thursday, July 30, 2009

WrkQry Distinct Records

How to get DISTINCT records using WRKQRY?

Define a report break containing field that you want distinct records. Then in Select Output Type, choose Summary Only. You will only see one occurrences for each distinct break level. The one downside to this is that Query/400 will insert a blank line in between each row.
If you want to print out the data without the blank lines, you can run the output of this query to a temporary file and then query the temporary file separately.

Tuesday, July 28, 2009

Arrays

What is an Array?

It is a collection of similar elements of same data type, we cannot have disimilar data types in a array. We can use array as a part of Data-Structure too as follows:

D Ds Inz
D ArrChgCde Dim(9999) Descend
D Count 5 0 Overlay(ArrChgCde:*Next)
D Code 5 0 Overlay(ArrChgCde:*Next)
D Desc 30 Overlay(ArrChgCde:*Next)


30