IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Retrieve rows which has a certain record in any field


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mbalaji2585
Warnings : 1

New User


Joined: 10 Nov 2006
Posts: 11
Location: mumbai

PostPosted: Wed Aug 01, 2007 1:23 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Aug 01, 2007 2:40 pm
Reply with quote

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
View user's profile Send private message
mbalaji2585
Warnings : 1

New User


Joined: 10 Nov 2006
Posts: 11
Location: mumbai

PostPosted: Wed Aug 01, 2007 4:14 pm
Reply with quote

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
View user's profile Send private message
mbalaji2585
Warnings : 1

New User


Joined: 10 Nov 2006
Posts: 11
Location: mumbai

PostPosted: Wed Aug 01, 2007 4:18 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Aug 01, 2007 10:22 pm
Reply with quote

Quote:
Can you tell me wahat this SS means.


SS means substring search. For more information, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.7.4?SHELF=EZ2ZO10I&DT=20060615185603
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top