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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 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 SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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