View previous topic :: View next topic
|
Author |
Message |
mbalaji2585 Warnings : 1 New User
Joined: 10 Nov 2006 Posts: 11 Location: mumbai
|
|
|
|
Hi,
I want to search the file for a certain record like 'e5010' which can be in any field say 5 to 9 or 13 to 17, etc........ of the input file.
When the record is present in a row, I want that particular row to be copied into another output file.
Is it possible to do it in a JCL. If so , can anyone give some idea regarding the same.
Thanks, |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Balaji,
Quote: |
I want to search the file for a certain record like 'e5010' which can be in any field say 5 to 9 or 13 to 17, etc........ of the input file. |
Quote: |
I want that particular row to be copied into another output file. |
Let me rephrase your requirement. You need to copy a fields if the string 'E5010' is present in the IP record. Correct me if I had understood wrongly.
If I got your requirement properly, use the following SORT technique -
Code: |
//SYSIN DD *
INCLUDE COND=(1,80,SS,EQ,C'E5010')
SORT FIELDS=COPY
OUTREC FIELDS=(1,10)
/* |
Assumptions made:
(1) Your IP file is 80 in length
(2) You wanted to copy first 10 bytes to OP file |
|
Back to top |
|
|
mbalaji2585 Warnings : 1 New User
Joined: 10 Nov 2006 Posts: 11 Location: mumbai
|
|
|
|
Hi ,
Thanks every one. I got the result by using your JCL. Actually istead of using SS in
INCLUDE COND=(1,2048,SS,EQ,C'E5010')
I was trying CH.
Can you tell me wahat this SS means.
Thanks once again to all. |
|
Back to top |
|
|
mbalaji2585 Warnings : 1 New User
Joined: 10 Nov 2006 Posts: 11 Location: mumbai
|
|
|
|
Hi rajesh,
can you share with the case of doing this using binary or linear search which you told.
Actually my file length is 2048.
Thanks, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|