The file in question is FB with LRECL=116. First six bytes belong to a code and the next 9 bytes are for an account number.
As per my new requirement I need the records in red at the bottom of the file. Basically I want all the records with code = 200105 and account no = 123456702 at the bottom of my file. Other records must be sorted the way it was done before. Now can I achieve this by just modifying the existing sortcard or do I have to introduce one extra sort step? I tried searching for such an example where sorting is done only at the OUTFIL level but couldn't find anything.
Use INREC with IFTHEN=(WHEN=(logexp) to identify the keys you want to outsort. Add (front or back of record, depending on variable/fixed) a byte set to a value higher than space. Sort on that byte as the major key. Remove that byte with BUILD in your OUTFILs.