Paul Gilmartin wrote on 07/20/2007 08:39:33 AM: > >SELECT FROM(IN) TO(OUT) ON(5,1,CH) LAST USING(CTL1) > >/* > I'm guessing that the ON clause tells it to look in position 5, > but what tells it that a blank is what it's supposed to look for?
DFSORT isn't looking for a blank - it's just looking for the same value in position 5 of every record. ON(5,1,CH) tells DFSORT to compare on position 5 of each record. LAST tells DFSORT to take the last record for each compared value. To get the last record in the file, we just need to have position 5 be the same for every record. Position 5 in every record can have a blank or an asterisk or anything else. > Wouldn't this be a good use for a zero-length key, which could be > presumed to be present and identical in every record, e.g.: > > //TOOLIN DD * > SELECT FROM(IN) TO(OUT) ON(1,0,CH) LAST USING(CTL1) > > Will this work? Why not? I suspect I know the answer, but, still, why? No, it won't work. 0 is invalid for the length in an ON field so you'll get a syntax error. Using a 0 length key would be one way to allow this kind of thing, but there would be other ways as well. Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED] Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/ ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

