Page 1 of 1

Extratcing only few records

PostPosted: Fri May 27, 2011 11:01 am
by nm992
I have a PS file with millions of records.I need to extract only those records which has word "Apple" in it.However word Apple do not occur at fixed place each time.How do i achieve that.

Re: Extratcing only few records

PostPosted: Fri May 27, 2011 11:54 am
by NicC
You cannot in JCL and you should know that by now. I presume you want to use a utiliity such as sort. Which sort product do you use? If DFSORT look up 'substring' in the manual. If you have Syncsort - I do not know but I would look for the same in their documentation.

Re: Extratcing only few records

PostPosted: Fri May 27, 2011 11:06 pm
by dick scherrer
Hello,

Depending on which sort you use on your system, this can be moved to that part of the forum.

Suggest you use the forum search as well as reading the appropriate sort product manual.

If you get stuck, post what you have found/tried and what questions/problems have occurred. Someone whould be able to help.

Re: Extratcing only few records

PostPosted: Thu Oct 20, 2011 11:19 pm
by soutik
Just Heads Up.
In case you are unable to use SYNCSORT, you can use COBOL INSPECT verb and get it done.

Re: Extratcing only few records

PostPosted: Thu Oct 20, 2011 11:22 pm
by Frank Yaeger
nm992,

You can use DFSORT statements like this:

   OPTION COPY
   INCLUDE COND=(1,n,SS,EQ,C'Apple')


where n is the LRECL of your input file.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080