View previous topic :: View next topic
|
Author |
Message |
sivassb
New User
Joined: 06 Jan 2006 Posts: 14
|
|
|
|
Hi ,
I need to write a REXX macro to find a string from the a sequence of job in the spool. In my project we have around 300 same jobs running every month it is very difficult to find the string. Could any one help me out to solve this Issue. Appreciate your help!!!
Thanks,
Siva. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Hi -
You don't need a macro, you need a REXX exec.
You can invoke any SDSF command from within REXX, just like you do in interactove mode (including scrolling, getting job names, reading and printing datasets, etc.).
To get all the possible commands, and explanations about invoking SDSF in batch, read the fine manual.
Here is an example for a simple SDSF invocation:
Code: |
ADDRESS TSO
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* Used by SDSF */
"ALLOC F(ISFOUT) NEW DELETE REU " , /* Used by SDSF */
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"
"ALLOC F(TEMPPRT) DA('MY.DATASET') SHR"
QUEUE "PRE CICSTCH1" /* SDSF commands in batch*/
QUEUE "DA"
QUEUE "FILTER JOBID EQ "JOBID
QUEUE "++?" /* Open output of job */
QUEUE "FIND 'MSGUSR'"
QUEUE "++S" /* Browse MSGUSR dataset */
QUEUE "PRINT FILE TEMPPRT " /* Print to temp dataset */
QUEUE "PRINT 1 999999"
QUEUE "PRINT CLOSE"
QUEUE "END"
QUEUE "EXIT"
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* Input to SDSF batch */
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,255)" /* Invoke SDSF */
EXIT |
O. |
|
Back to top |
|
|
sivassb
New User
Joined: 06 Jan 2006 Posts: 14
|
|
|
|
Hi ,
Thanks for the info. I'm new to Rexx could you pls explain little more on the SDSF invocation example
Thanks,
Siva |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I think that the fine manual is very clear - however:
Allocate ISFIN as the input file for SDSF.
Allocate ISFOUT as the output of SDSF. In this file you'll see the screens the SDSF processes, just like the screens you see when you do actions in SDSF in interactive mode.
You then QUEUE all the desired command, and at the end you write them to ISFIN.
The next step is to invoke SDSF itself. I'm doing it using the SELECT service, but you can invoke it in other ways (like CALL). The parameters to SDSF in my case are the screen width and length.
In my example, I'd like to see only jobs that start with CICSTCH1 ("PRE CICSTCH1"). Then I'm going to the DA screen, and filtering the jobs by JOBID (which is a REXX variable in my case).
Then I'm going to the first line ("++?"), putting a "?" in the command line.
The "?" will open the datasets of the desired job, and I'm looking for the dataset "MSGUSR". The next command will open it in browse mode ("++S").
When I'm in my dataset, I'm using the PRINT commands to print the MSGUSR to a file I allocated in advance (TMPPRT).
Thats all.
Good luck |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
HI ofer71 & All,
I was really interested when I saw your reply. I tried the thing and run the rexx routine, but nothing is writting in the temp dataset.
May be, in some way I am wrong. I changed the rexx routine by giving the following things -
1. Name of the temp dataset
2. Pre <My_Job_Name>
3. jobid eq <My_Job_ID>
4. find 'JESYSMSG' /* This step should be present in
every job */
After that I ran the REXX routine but it is not printing anything in the temp dataset.
Thankx in advance,
Regards,
Amitava Chowdhury |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
My way to debug a SDSF invocation is to allocate ISFOUT to a real dataset, and look through it after the REXX finished.
In ISFOUT you'll see the actual screens that SDSF produce according to your requests. It also shows the error messages at the top of the screen, just like in interactive mode.
So, just allocate the ISFOUT to a cataloged dataset, keep it, and research it.
O. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi ofer71,
I ran the tool in that way. But in the temp dataset (I mean - the output dataset) is not getting any information. The job is still present in the spool.
Even then its not working.
Please need some clarification.
Regards,
Amitava Chowdhury |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Hi -
Try to track the output of the "PRINT 1 999999" command in ISFOUT. Look at the top of the page to see the message.
O. |
|
Back to top |
|
|
sivassb
New User
Joined: 06 Jan 2006 Posts: 14
|
|
|
|
Hi ,
Even I tried to execute this, I was also not getting any information in the ISFOUT.
Pls help,
Thanks,
Siva |
|
Back to top |
|
|
Ayyappan
New User
Joined: 05 Jul 2005 Posts: 31 Location: India
|
|
|
|
Hi All,
I tried this and in the first screen of ISFOUT, i got screen definition error. Then i corrected the line ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,255)" /* Invoke SDSF */ to have parm as ('++32,255')" . Now i am getting the output.
Thanks.
Ayyappan |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi Ofer,
I have endlessly searched for a good example for batch SDSF and truly ur example was the most apt and to the point.. thumbs up man...
Thanks a lot... |
|
Back to top |
|
|
|