Extratcing only few records

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Extratcing only few records

Postby nm992 » Fri May 27, 2011 11:01 am

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.
Posts: 43
Joined: Sun Jul 11, 2010 11:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extratcing only few records


Re: Extratcing only few records

Postby NicC » Fri May 27, 2011 11:54 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Extratcing only few records

Postby dick scherrer » Fri May 27, 2011 11:06 pm


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.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Extratcing only few records

Postby soutik » Thu Oct 20, 2011 11:19 pm

Just Heads Up.
In case you are unable to use SYNCSORT, you can use COBOL INSPECT verb and get it done.
Posts: 2
Joined: Wed Oct 19, 2011 4:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extratcing only few records

Postby Frank Yaeger » Thu Oct 20, 2011 11:22 pm


You can use DFSORT statements like this:

   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
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Return to JCL


  • Related topics
    Last post