MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

an idea to search 7 files one after another.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Jan 05, 2009 9:52 am    Post subject: an idea to search 7 files one after another. Reply with quote

Hi,

We receive 7 big files and need to search through them for a particular string. I need your help as we want to automate this process. The length of each files is 567 and record format is FB.

For example, if we need to search for "ABC123" (starts at 10th position) in all these files, I would code it like this:

Code:

//STEP0001 EXEC PGM=ICEMAN
//SORTIN   DD DSN=FILE1,           
//            DISP=(SHR,KEEP,KEEP) 
//         DD DSN=FILE2,         
//            DISP=(SHR,KEEP,KEEP)
//         DD DSN=FILE3,         
//            DISP=(SHR,KEEP,KEEP)
//         DD DSN=FILE4,         
//            DISP=(SHR,KEEP,KEEP)
//         DD DSN=FILE5,         
//            DISP=(SHR,KEEP,KEEP)
//         DD DSN=FILE6,         
//            DISP=(SHR,KEEP,KEEP)
//         DD DSN=FILE7,         
//            DISP=(SHR,KEEP,KEEP)
//SORTOUT  DD SYSOUT=*               
//SYSOUT   DD SYSOUT=*               
//SYSIN    DD *                       
 OPTION COPY                     
 INCLUDE COND=(10,06,SS,EQ,C'ABC123')
/*                                   


But, the disadvantage with this method is one would not know in which file the record is found as we need to act on the found record. Our idea is to search each file individually, if not found then go to next file and so on.....

Please suggest.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
callanand
Beginner


Joined: 12 Jun 2007
Posts: 23
Topics: 2

PostPosted: Mon Jan 05, 2009 10:11 am    Post subject: Reply with quote

MF,

Try this Sort jcl
Code:

//STEP04   EXEC PGM=ICETOOL
//IN1        DD DSN=Input dataset1,DISP=SHR
//IN2        DD DSN=Input dataset2,DISP=SHR
//IN3        DD DSN=Input dataset3,DISP=SHR
//OUT1     DD DSN=Output dataset1,DISP=SHR
//OUT2     DD DSN=Output dataset2,DISP=SHR
//OUT3     DD DSN=Output dataset3,DISP=SHR
//TOOLIN    DD *
 COPY FROM(IN1)  TO(OUT1)  USING(CNT1)
 COPY FROM(IN2)  TO(OUT2)  USING(CNT1)
 COPY FROM(IN3)  TO(OUT3)  USING(CNT1)
//CNT1CNTL DD *
 Sort fields=copy
 INCLUDE COND=(10,06,SS,EQ,C'ABC123')
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//SYSOUT   DD SYSOUT=*

With this you would come to know which input file had your string.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jan 05, 2009 11:04 am    Post subject: Reply with quote

mf_user,

Use ISPF search facility 3.14 or 3.15 with IDPFX option. Search this forum for examples of it.

Callanand,

You still have to manually relate the string found to the dataset name with your example

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Jan 05, 2009 11:44 am    Post subject: Reply with quote

Ok Kolusu. I will search the forum.

Thanks for the idea.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Jan 23, 2009 8:15 am    Post subject: Reply with quote

Kolusu, I have searched the forum but found nothing. There were entries found but they use IDPFX on PDS. I tried using it on PS files and it gave "Erroneous or Conflicting usage of parameter" in the sysout ! I think IDPFX does not work for PS files.

Please help.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jan 23, 2009 8:52 am    Post subject: Reply with quote

either set up a step for each file, or
instead of having each file a PS, make it a member of a PDS and then use 3.14 and IDPFX.

though the PDS idea seems cumbersome, you would never have to change your jcl.

actually, what will you be doing when you have these 'hits'?

if you could explain why and what you are going to be doing, something else could be suggested.
But at this point, we only know you want to look at a bunch of big files.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Jan 23, 2009 4:29 pm    Post subject: Reply with quote

MF,

Is there a unique field within the record which could be used to identify which file it came from? If there is no such field, can you preprocess the data to add one? Taking into account the size of these files, might there be a way to automate this when the data is first created?
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group