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
 

 

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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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