Philpl1jb
24105 pts. | Dec 2 2008 2:13PM GMT
A logical with UNIQUE keyword will prevent adding records that violate the rule. It will error when compiled if the file contains duplicte key values.
The method to see one occurance of each varies with the access method.
In QUERY/400 you could use report summary functions on fld1 and other fields that you want to report.
In RPG you could use the Key - something like this
*loval SETTLL myfile
Read myfile
dow not %eof(myfile)
process your record
FLd1 SETGT myfile
Read myfile
enddo
The SETGT will position you at the first record past the key value.
Phil
Gilly400
23625 pts. | Dec 2 2008 3:01PM GMT
Hi,
Or if you’re using SQL you could use a SELECT DISTINCT.
Regards,
Martin Gilbert.
Philpl1jb
24105 pts. | Dec 2 2008 4:45PM GMT
Select distinct works great provide that all the fields retrivied are the same for a specific value of FLD1. It retrieves distinctly different rows.






