> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Richard Pinion
> Sent: Tuesday, September 28, 2010 10:31 AM
> To: [email protected]
> Subject: SORT question
> 
> I have a large file that is sorted in ascending order by a date field,
> YYYYMMDD.  I want to run a sort fields=copy with selection criteria
> against this file.  One of the selection criteria is the date field.  I
> would like the sort to terminate once the date field in the file is
> greater than my selection date.  Is this possible?

OPTION COPY
OMIT COND=(datepos,datelen,CH,GT,'YYYYMMDD')

where YYYYMMDD is your selected date.  If date is not in character format, 
change CH and date literal to match actual format.

You don't need the SORT keyword since this is just a copy.

HTH

Peter
--

This message and any attachments are intended only for the use of the addressee 
and
may contain information that is privileged and confidential. If the reader of 
the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


----------------------------------------------------------------------
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

Reply via email to