View previous topic :: View next topic
|
Author |
Message |
Bhargav_1058
New User
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You will probably need to use VPUT / VGET to pass information to / from the edit macro. |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
|