Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Retrieve rows which has a certain record in any field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Retrieve rows which has a certain record in any field
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: 1439
Location: Bangalore,India

PostPosted: Wed Aug 01, 2007 2:40 pm    Post subject:
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    Post subject: Re: Retrieve rows which has a certain record in any field
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    Post subject: Re: Retrieve rows which has a certain record in any field
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 Moderator


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

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

Quote:
Can you tell me wahat this SS means.


SS means substring search. For more information, see:

http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us