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 for a text in a job that is in either of the 2 lib's

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Search for a text in a job that is in either of the 2 lib's
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: 8593
Location: Back in jolly old England

PostPosted: Mon Dec 14, 2009 5:42 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1224
Location: Israel

PostPosted: Tue Dec 15, 2009 4:29 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX 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 update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts Only text from varchar Seppe DB2 8 Thu Apr 21, 2016 10:42 pm
No new posts How to send email with Rich Text usin... santhosh5983 JCL & VSAM 4 Fri Apr 08, 2016 2:30 am


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