Gil, Victor on IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> wrote on 08/26/2010 07:35:48 AM: > Can DFSORT filter [not just DISPLAY] a QSAM input by a fixed field > in the STCK format? > > Say, the file records have 8-byte STCK time in columns 11-18, how > should I code the control statements to only INCLUDE records which > are older than "current-time less 30 minutes"?
DFSORT doesn't have built-in functions for doing INCLUDE with STCK format or for doing "time arithmetic". But ... What you could do is: Use INREC to: -Get the current time (curtime) as Z'hhmm' after the end of each record. -Get the current time minus 30 minutes (curtime-30) from curtime by doing the appropriate "time arithmetic" using DFSORT's arithmetic functions. -Convert each STCK value in the record to a Z'hhmm' value (rcdtime) after the end of the record using the TC2 format. So after INREC, your records would look like this: |original data.....|curtime (Z'hhmm')|curtime-30 (Z'hhmm')|rcdtime (Z'hhmm')| Then use OUTFIL INCLUDE to do the compare with the constructed rcdtime and curtime-30 fields from the end of the record. Finally use OUTFIL BUILD to remove the curtime, curtime-30 and rcdtime fields from the end of the record. If your input records are VB, you'd want to put the extra fields between the RDW and first data byte rather than at the end of the record. Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, 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 lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html