We have a DB Unload file which contains the daily backup of an IMS database. This Unload file is in VB format with 1 record for each segment record.Sample data is attached.
I have to put up a sort on the same that simply filters the records for a particular value at a particular position as shown below. However this field is PD i.e Packed Decimal S9(16) present at position 89 in the file. The issue here is that this field is present in only seg2 of the DB & other records have values spaces or inavlid PD values. Hence when I use simple include codition using PD(Adding 4 in the field location as its a VB File)
I get a SOC 7 at very first record of the file. For this there is a workaround such that the field present at 79 location indicates seg no. i.e. if seg 2 then its value is 000200020. Accordingly I have tried to put both the conditions together using AND in INCLUDE but that doesn't work either for obvious reason that the PD field is accessed. So our requirement is to firstly filter records for 000200020 condition & then filter these records based on PD condition. Moreover the Input File is VB & I need output file in FB format hence I cannot use OUTREC IFTHEN because i have used VTOF in the OUTFIL. As of now we have made this work using two sort cards, 1 for VTOF & 2 for actual sort. However I wish to know if there is any other workaround available for this so that both VTOF & Nested filtering of records be done in the same SORT so that this SOC 7 is avoided.