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

Search thru SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sivasree03

New User


Joined: 12 Sep 2008
Posts: 8
Location: chennai

PostPosted: Wed Feb 18, 2009 5:31 pm
Reply with quote

Hi,

I have 100 strings in FILE1 and I have FILE2 with the length of 32756 bytes. I have to search each and every string from FILE1 in FILE2. This string can be in any place in FILE2. If the sting found in FILE2 then I have to write entire record from FILE2 to FILE3.

Is there any way I can do this thru SORT. Please post the SORT card for this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 18, 2009 9:53 pm
Reply with quote

Hello,

How many records are in file2?
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 Feb 18, 2009 10:43 pm
Reply with quote

You can use DFSORT's substring search to do this kind of thing. For example:

Code:

   OPTION COPY
   INCLUDE FORMAT=SS,
      COND=(1,32752,EQ,C'string001',OR,
        1,32752,SS,EQ,C'string002',OR,
        ...
        1,32752,SS,EQ,C'string100')


However, you can only search up to position 32752, not 32756.

If you don't want to hardcode the INCLUDE statement, you can generate it from the strings in input file1.
Back to top
View user's profile Send private message
sivasree03

New User


Joined: 12 Sep 2008
Posts: 8
Location: chennai

PostPosted: Thu Feb 19, 2009 10:39 am
Reply with quote

Thanks Frank, We will be having millions of records in FILE2 and I don't want to hard code strings in SORT CARD. Can you let me know the logic to get the strings from FILE1.
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: Thu Feb 19, 2009 9:42 pm
Reply with quote

I don't know what having millions of records in FILE2 has to do with hardcoding the strings from FILE1. But if you want me to show you how to generate the control statement from the records in FILE1, tell me the starting position and length of the string in the FILE1 records. Also, tell me the RECFM and LRECL of FILE1.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top