Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Search thru SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Search thru SORT
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

Site Director


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

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

Hello,

How many records are in file2?
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 Feb 18, 2009 10:43 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Feb 19, 2009 9:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm
No new posts Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us