Page 1 of 1

SOC 7 Abend in sort due to file structure

PostPosted: Fri Mar 07, 2014 12:54 pm
by nehabac
Hi,
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.
SampleData.txt

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)
INCLUDE COND=(93,9,PD,EQ,528625)
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.

Thanks&Regards.

Re: SOC 7 Abend in sort due to file structure

PostPosted: Fri Mar 07, 2014 2:52 pm
by NicC
Please cut and paste the data and use the code tags to preserve alignment. Many people will not go near an attachment either for fear of 'contamination' or because site security policy does not allow it.

Re: SOC 7 Abend in sort due to file structure

PostPosted: Fri Mar 07, 2014 4:17 pm
by BillyBoyo
It is not so much of a work-around, as it is the sensible way to do it. Knowing which segment you are looking at tells you which data-structure to use.

Where you want to do a simple include, you need to test the segment value first and then use AND for your condition to select the records. Select the segment, select the record. Same if you need to do anything more complex. Know the format of the data (segment indicator tells you), use the data.