View previous topic :: View next topic
|
Author |
Message |
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
Using rexx, I need to find some words in a job batch and send a message for the user when found them.
My rexx has the name @CHKDB2.
For the message i will use the “Address TSO” with “send” to the “user id”.
For the “words i want to find” it happens like this:
1st. A job runs and call a rexx proclib (pgm=ikjeft01,parm=’@chkdb2 &member(1,8, ) 6subsys(1,8,)’ .
2nd. after the rexx find the forbidden words in the dd IN1 of the job will send a message to the userid.
I have a very old rexx, to much complex and not adequated to this propose. Is it possible give any example?
Many thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
I need to find some words in a job batch |
You posted only irrelevant details ( who cares about the REXX script name ? ) ...
take a deep breath and rewrite clearly the requirement
why rexx ??? why a message ???
there are zillions of reason for which the message can be lost
the user not logged on, or even a tso profile setting to prevent reciving messages
on the other side there are quite a few examples on how to do it using sort and emailing
what prevents the luser to look at the job output him/herself ? |
|
Back to top |
|
|
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
This procedure must be regulated by a distintc software (Endeavor). And that's the reason for use rexx. The option emailing is always good (thanks), but my major concern is with the code of the searching words. Could you show me same examples, please? Thank you. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
vasco ferreira wrote: |
Could you show me same examples, please? Thank you. |
First tell us what your system management product is: SDSF, IOF, (E)JES, Mk I eyeball on dead-tree listings...? |
|
Back to top |
|
|
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
It's Z/OS rel 01.13 using ISPF (and SDSF) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
You still have not told anything useful!
let' s ask it like a quiz
(1)
some jcl/job ..... created some dataset
You want to check if the incriminated dataset contains some <string>
and in case notify somebody
( could be a subsequent step in the same jcl/job or a <successor> job,
does little difference)
(2)
some jcl/job was run
You want to scan from a different jcl the JES <output> of the <previous/above mentioned> jcl/job
... ... ...
(3)
some jcl/job is running
You want to scan from <inside> the running jcl/job JES <output> for the running job
... ... ...
please reply 1/2/3
getting info is like pulling a tooth,
the dentist gets paid for it
we do it on our time and free of charge
|
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I assume it's option 1 as the OP mentions a DDname IN1.
So, the Rexx is in the same batch job, and reads the dataset to see if some words exist? Seems easy enough.
Have you tried SUBSTR or INDEX for example? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
in any case the TS might find useful to meditate on the entropy of the initial post |
|
Back to top |
|
|
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
Yes is option 1. Thanks |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Isn't INDEX deprectaed and POS preferred? Or is it the other way round?
But read that datset line-by-line. Check each lien (using POS or INDEX) for the string, raise a flag (perhaps store the line no in a stem). At end, if stem.0 > 0 write out the message or whatever. Next step send the message (could do it via internal reader in previous step but I am simple and like to keep things simple). |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
vasco ferreira wrote: |
Yes is option 1. Thanks |
You want to check if a data set created in a previous step contains a certain token?
Seriously, on the face of it this is a very trivial task, one that I would assign to a junior programmer with confidence that heesh would finish it in a day or two. Are there complexities that you are concealing from us, or are you truly incapable of writing this script? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect that the first time thru is a bit daunting . . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
IMO the most effective solution would be a TWO step approach
ISRSUPC with the
FMSTOP ==> stop at first match
it will end with a RC 1 for a match RC 0 if nothing is found
and a second step to send whatever
Code: |
****** ***************************** Top of Data ******************************
000002 //SEARCH EXEC PGM=ISRSUPC, *
000003 // PARM=(SRCHCMP,
000004 // 'FMSTOP')
000005 //NEWDD DD DSN=Your dataset,
000006 // DISP=the appropriate disp
000007 //OUTDD DD SYSOUT=(*)
000008 //SYSIN DD *
000009 SRCHFOR 'the string'
000010 /*
****** **************************** Bottom of Data **************************** |
|
|
Back to top |
|
|
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
1º When some user submit a job (and this one is a example which forbidden words are DB2A, DBSB and DB2D)…
//!JOBSISCAJCL06 JOB ,'TESTE @CHKDB2',
// MSGLEVEL=(1,1),
// MSGCLASS=X,
// CLASS=!CLASSE4,
// NOTIFY=PRDVCF
//*
//LIBSRCH JCLLIB ORDER=!JPRCLIB
//* JCLLIB ORDER=!TESTE
// INCLUDE MEMBER=$BATCH
// INCLUDE MEMBER=$TCPIP
//*
//STEP01 EXEC PGM=PSUBJOB
//JOBIN DD DISP=SHR,DSN=NDVRCER.CER.JCL.FTS01.PT(VASCO)
//JOBOUT DD SYSOUT=(2,INTRDR)
//SYSIN DD *
#01. DB2A
#02. DBSB
#03. DB2D
2º …is calling this step in other process (not important in this matter)…
//*************************************************************
//CHKJCL1 EXEC PGM=IKJEFT01,
// PARM='@CHKDB2 &MEMBER(1,8, ) &SUBSYS(1,8,)'
//SYSEXEC DD DISP=SHR,DSN=NDVRDES.DES.JCL.PRCLIB01.PT
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//IN1 DD DISP=(OLD,PASS),DSN=&&ELMOUT
//IN2 DD DISP=SHR,DSN=NDVRDES.DES.FILE.CNTL01.PT
//*
3º …and the rexx code I made.
000001 /* Rexx @CHKDB2 */
000002
000003 signal on syntax /* trap rexx syntax errors */
000004 signal off novalue /* trap unititalized variables */
000005 signal on error /* handle positive rc command failures in code */
000006 signal on failure /* handle negative rc command failures in code */
000007 signal on halt /* allow normal hi/he termination */
000008
000009
000010 Call Main_Routine
000011 Return
000012 Main_Routine:
000013 return_code = 0
000014 Call Valida_Input
000015 Call ini_vars
000016 Call Valida_Env
000017 Call alloc_files in1 f1
000018 say in1 & say in2
000019
000020 Call alloc_files_pds in2 f2
000021
000022 "EXECIO * DISKR f2 (STEM tabclass. FINIS"
000023 if rc <> 0 then
000024 do
000025 say 'Erro na leitura do ficheiro de input: 'f2
000026 return_code = 16
000027 Call exit
000028 end
000029 if tabclass.0 = 0 then
000030 do
000031 say 'Ficheiro de input vazio: 'f2
000032 return_code = 16
000033 exit 4
000034 end
000035
000036 mylist="'DB2A ' DB2B ' DB2D '"
000037 drop (mylist) find
000038 exit
My Rexx experience is in a very low level (as all you noticed!...)
I just had a beginner course two months ago for the first time and now I have this work to finish.
And I really want to make it.
Will you help me?
Many thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
This procedure must be regulated by a distintc software (Endeavor). And that's the reason for use rexx. |
utter horse manure
when defining the solution for a requirement a check is usually made to see if the required resources are available
and those include the SKILLS
the choice of using REXX without the appropriate skills is just plain inconsiderate
You will find little simpathy/code here ( it should be custom written for Your requirement ),
I provided You with a sound alternative to a clumsy rexx
why do You refuse to take it into consideration ?
You can use as many SRCHFOR clauses for as many <strings> you need to look for |
|
Back to top |
|
|
vasco ferreira
New User
Joined: 12 Jul 2008 Posts: 32 Location: sintra - portugal
|
|
|
|
I'm taking it into consideration, Enrico. Thank you.
The problem is: this is a small part of a existing process wich includes a job and a rexx and i have to include this part because there are some colleagues working in the same. Thanks for your help. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
I will presume that the code that you show is but a skeleton, as there isno hope of its actually running. I strongly recommend that you transfer this problem to our sister forum, as you admittedly a beginner in Rexx, and will likely find more suitable help there. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
The problem is: this is a small part of a existing process wich includes a job and a rexx and i have to include this part because there are some colleagues working in the same. |
utter nonsense |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It may be getting to the point where this topic will not become productive (again?).
@vasco
Please explain why the SUPERC suggestion from Enrico cannot be used?
Why is REXX demanded? I would hope the goal was to get the correct "solutioin" rather than get hung up on the method? |
|
Back to top |
|
|
|