Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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: 1243
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us