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

Search for a text in a job that is in either of the 2 lib's


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Mon Dec 14, 2009 4:48 pm
Reply with quote

Hi,

I am building a REXX tool (as shown below) for the following requirement.

1). Search for a job in 1st AAA.BBB.CCC library, If the job is found find for the text PRINT in the job. if found display on the screen.
2). If the job is not present in the first library, search for the same text in 2nd library DDD.EEE.FFF, If found display the same on the screen.
3). If the job is not present in 2nd library the display JOB is not found.

Code:
PARSE VAR MEMBER                                                   
 DSNAME1 = 'AAA.BBB.CCC'                                   
 DSNAME2 = 'DDD.EEE.FFF'                                           
                                                                   
 DSNAME = DSNAME1 || '(' || MEMBER || ')'                           
 ADDRESS ISPEXEC "VIEW DATASET('"DSNAME"') MACRO(VMOBMAC)"         
 IF RC = 0 THEN EXIT                                               
 DSNAME = DSNAME2 || '(' || MEMBER || ')'                           
 ADDRESS ISPEXEC "VIEW DATASET('"DSNAME"') MACRO(VMOBMAC)"         
 IF RC = 0 THEN EXIT                                               
 ELSE                                                               
 IF RC <> 0 THEN                                                   
    DO                                                             
    SAY ' '                                                         
    SAY "JOB IS NOT PRESENT IN PROD LIBRARIES "                     
    SAY ' '                                                         
    END                                                             
 EXIT                                                               



I am achieving this by running a macro VMOBMAC,
VMOBMAC:
1). It will find for the text PRINT in the job.
2). If found it displays on the screen.
3). else it says text not found.

The return code from the macro is always 0, control is not searching for the job in 2nd library. please help me on this.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Dec 14, 2009 5:42 pm
Reply with quote

You will probably need to use VPUT / VGET to pass information to / from the edit macro.
Back to top
View user's profile Send private message
valyk

Active User


Joined: 16 Apr 2008
Posts: 104
Location: South Carolina

PostPosted: Tue Dec 15, 2009 1:47 am
Reply with quote

Why call an external macro? I would read a parm file that has all the libraries already specified. Read each library and do the following:

Code:

IF SYSDSN("'"LIBRARY'('MEMBER")'") = 'OK' THEN
  SAY DSNAME'('MEMBER') <-- FOUND IT!'
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 15, 2009 2:04 am
Reply with quote

valyk,

with typical clarity and precession, the TS did not make himself very clear.
Quote:
If the job is found find for the text PRINT in the job


He is searching for the text 'PRINT' in a JOB in one of the libraries.

Just another fool who wants to reinvent 3.12/.13.

would be nice to be paid to generate new wheels all the time,
and nice to work in a place that has no real business needs for which requires code.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Dec 15, 2009 4:29 am
Reply with quote

Quote:
I am achieving this by running a macro VMOBMAC,
VMOBMAC:
1). It will find for the text PRINT in the job.
2). If found it displays on the screen.
3). else it says text not found.

Which means: if you have 200 members in your libraries, you'll have to hit PF3 200 times each time you run your thing...
You'll also have to write down who have and who haven't the PRINT word, because when it's finished, there's... no result left.
Doesn't seem very attractive to me...

Use super-search (ISRSUPC) in a batch job or inline in a "rexx tool".
The options are very well documented here and here.

Tips:
Concatenate the 2 libraries. If a member is found in the first one, it will not search the other (unless you specify SDUPM).
Use parameters to reformat your output (LMTO, NOSUBS, ...)
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
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 first column truncated in search result IBM Tools 13
No new posts TEXT-TO-PDF Compuware & Other Tools 1
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
Search our Forums:

Back to Top