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

Rexx to find a string from a job in the sdsf.


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

New User


Joined: 06 Jan 2006
Posts: 14

PostPosted: Wed Jan 18, 2006 12:30 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 18, 2006 2:49 pm
Reply with quote

Hi -

You don't need a macro, you need a REXX exec. icon_biggrin.gif

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
View user's profile Send private message
sivassb

New User


Joined: 06 Jan 2006
Posts: 14

PostPosted: Tue Jan 24, 2006 5:48 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 24, 2006 6:27 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 9:41 am
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 25, 2006 10:25 am
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 4:43 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 25, 2006 5:06 pm
Reply with quote

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
View user's profile Send private message
sivassb

New User


Joined: 06 Jan 2006
Posts: 14

PostPosted: Thu Feb 02, 2006 4:23 pm
Reply with quote

Hi ,

Even I tried to execute this, I was also not getting any information in the ISFOUT.

Pls help,

Thanks,
Siva
Back to top
View user's profile Send private message
Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Fri Feb 03, 2006 1:55 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Apr 15, 2008 2:49 am
Reply with quote

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
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top