I need to create a RPG report that is to be sorted by Div, Mkt, and Grp. The relationship between the three fields are one to many(Many Grp under one Mkt, many Mkt under one Div). The file I am using(File1) is sorted by Div and Mkt, doesn't contain Grp but has a field called Flag which is to determine which records are to be included in the report and is passed to File1 using OVRDBF from another file. The Grp field is found in another file(File2). I created a Physical file DDS(File3) with all the fields of File1 + the Grp field from File2 and populated it by making File3 the output of a query which joined File1 and File2 together but doesn't get the get the effects of the OVRDBF.
I am thinking of using File3 as the target of the OVRDBF instead of File1 so that the flags can be passed to a file that has all the fields I need but I'm not sure it will work so I think I might need to sort File1 instead.
Does anyone know how to perform a sort inside an RPG program?
I am thinking of using File3 as the target of the OVRDBF instead of File1 so that the flags can be passed to a file that has all the fields I need but I'm not sure it will work so I think I might need to sort File1 instead.
Does anyone know how to perform a sort inside an RPG program?