View previous topic :: View next topic
|
Author |
Message |
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
Hi!
I am submitting a Job from a rexx program in TSO Address Space using
"SUBMIT 'XXXX.XXXX.XXX(YYYYYYYY)'"
Now I want to capture the Job Number which appears in the message :
"IKJ56250I JOB XXXXXX40(JOB09614) SUBMITTED"
after submitting the job in a variable to be used in a rexx program which
uses SDSF API.
For exapmle refering to the message above if I can store the Job Number : 09614 in a variable ,say M ,then I can use it to check my job using the logic :
do ix=1 to JNAME.0
if JNAME.ix = M then do
Address SDSF "ISFACT ST TOKEN(’"TOKEN.ix"’) PARM(NP ?)" , "( prefix abh_"
/*** my program logic **/
Now how to I capture the Job Number from the message that is displayed immediately after job submission to a variable ?
If using Outtrap is the answer (which I am not sure of) ,,please provide some skeleton code as well.
Please help. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Is this yet another one of those things that submits a job and waits for it to finish before doing something else
Please tell me it isn't
Please tell us what you are trying to do and why the job number is so important |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
expat wrote: |
Is this yet another one of those things that submits a job and waits for it to finish before doing something else
Please tell me it isn't
Please tell us what you are trying to do and why the job number is so important |
Hi Expat,
Ironically , yes it is yet another of those things which submits a job and waits for it to execute.I have explained my objectives below.If u feel that there is a better approach to achive the same result other than the approach I have taken , please let me know.
There are a few jobs which we execute over and over for testing.I am making a tool using Rexx ,thus allowing the users to interact with the system through ISPF Panels.
Many users will simultaneously run the jobs and I wanted to Capture the Job number for unique identification,since I am not aware of everybody's RACF ID and Username in the team.Also users will submit multiple jobs not necessarily in the same order.
If I can search with the Job No then it ensures that I can search the JESYSMESG for the output (i need to search in JESYSMESG only for testing). unique for each user.I am using the userids to be appended in a temp dataset name which will contain the output copied from JESYSMESG.
But I got the answer.Many thanks to Kevin for the links and the sample code.Also the links he posted are priceless for me .Indeed I got to admit that I didnot search enough before posting the question. |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
Hi Kevin,
Many thanks for the answer.
It works .
The threads are also very helpful.
My gratitudes for the same.
I admit that I did not put enough effort to search the whole forum before posting the question.Will do from now on . |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Anirban Bhattacharjee wrote: |
There are a few jobs which we execute over and over for testing.I am making a tool using Rexx ,thus allowing the users to interact with the system through ISPF Panels.
Many users will simultaneously run the jobs and I wanted to Capture the Job number for unique identification,since I am not aware of everybody's RACF ID and Username in the team. |
Presumably these users (at least the ones who will be using this tool) are limited to submitting jobs whose names begin with their TSO IDs? In any case you are aware that the TSO ID can be retrieved via the USERID function?
Quote: |
Also users will submit multiple jobs not necessarily in the same order.
If I can search with the Job No then it ensures that I can search the JESYSMESG for the output (i need to search in JESYSMESG only for testing). unique for each user.I am using the userids to be appended in a temp dataset name which will contain the output copied from JESYSMESG. |
But why does this require that the on-line process wait? Indeed, it would seem that doing this would limit a user to submitting a single job at a time, waiting for it to finish (or abend with an Sx22...), and then repeating the process; very wasteful and inefficient. |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
Akatsukami wrote: |
Anirban Bhattacharjee wrote: |
There are a few jobs which we execute over and over for testing.I am making a tool using Rexx ,thus allowing the users to interact with the system through ISPF Panels.
Many users will simultaneously run the jobs and I wanted to Capture the Job number for unique identification,since I am not aware of everybody's RACF ID and Username in the team. |
Presumably these users (at least the ones who will be using this tool) are limited to submitting jobs whose names begin with their TSO IDs? In any case you are aware that the TSO ID can be retrieved via the USERID function?
Quote: |
Also users will submit multiple jobs not necessarily in the same order.
If I can search with the Job No then it ensures that I can search the JESYSMESG for the output (i need to search in JESYSMESG only for testing). unique for each user.I am using the userids to be appended in a temp dataset name which will contain the output copied from JESYSMESG. |
But why does this require that the on-line process wait? Indeed, it would seem that doing this would limit a user to submitting a single job at a time, waiting for it to finish (or abend with an Sx22...), and then repeating the process; very wasteful and inefficient. |
Hi,
Yes we have to wait for the previous jobs to finish.This is a part of the activity defined for our testing.Once the job finishes the outout of this job
produdced the last step will be given input to the next job.
But I thank for taking time to review my approach. Now if the online process does not wait for the job to finish,,,how to get the output file....?Please advise.
What should I do to enable users to submit the job concurrently and making it more efficient.Please let me know if any specific info is required to analyze the scenario from ur end.
Thanks again for taking time to review my post |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
For only 1 user, this is a wasteful approach. For many users, this could have a larger negative affect on the system.
You might consider having the user submit whatever job(s) and at the end of each job, send an e-mail to the user with info from the job as well as the job number. We do this all of the time. |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
dick scherrer wrote: |
Hello,
For only 1 user, this is a wasteful approach. For many users, this could have a larger negative affect on the system.
You might consider having the user submit whatever job(s) and at the end of each job, send an e-mail to the user with info from the job as well as the job number. We do this all of the time. |
Hi dick Ok..but I have to make the tool where users will select the job numbers.
Say if u enter 1 in the ISPF panel and press Enter , it will submit Job1. Then u press option C1 it will show the output of Job1 from JESYSMESG.Then u press Option2 it will Submit Job2 with the output file produced in Job1 .....and so on and so forth.
Any better ideas..@ dick scherrer |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Any better ideas..@ dick scherrer |
Yes. Change the process so that the jobs send the job number to the user and then they can use the job number to look at the job in the spool. . . |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Instead of submitting a job, waiting for it to finish, submitting the next and so on why not submit all jobs at once with the second and subsequent jobs being held with the job that is to precede them issuing a release on successful completion? Or, have the first job submit the next and so on? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Anirban Bhattacharjee wrote: |
Yes we have to wait for the previous jobs to finish.This is a part of the activity defined for our testing.Once the job finishes the outout of this job
produdced the last step will be given input to the next job.
But I thank for taking time to review my approach. Now if the online process does not wait for the job to finish,,,how to get the output file....?Please advise.
What should I do to enable users to submit the job concurrently and making it more efficient.Please let me know if any specific info is required to analyze the scenario from ur end.
Thanks again for taking time to review my post |
It depends in part on the nature and size of your system. At my site, we have separate production and development sysplexes, as well as several stand-alone systems for system-level testing. What we would consider a trivial expenditure of machine resources may represent an intolerable burden for you. It also depends on whether you are running JES2 or JES3; in the latter, you can fairly easily network jobs together (although many shops have modifications to JES2 that allow this).
Assuming that you run JES3, I would do something like this:
- Have the user specify the jobs to be run (perhaps the name of the library and member) and the order in which they are to be run (for simplicity’s sake, I will assume that they will run one at a time).
- Have your tool copy each job to a temporary data set, determining or deciding the job name, and insert a JES3 NET card after the job card in each one.
- At the end of the job, add two steps. The first retrieves the job name and number from the control blocks (IIRC, you’ll want the ASCB) and writes it to a temporary data set. The second one reads that data set and invokes your spool management software (probably (E)JES) to extract the information you want from the spool and set it up for the next job.
- Submit the job.
If this takes long enough (and we have test-generator tools that fabricate and submit hundreds of jobs in a complex DJC network that it creates on the fly; such a generation may take 10-15 minutes to run), you may wish the tool to submit a job does all this in the background. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anirban Bhattacharjee wrote: |
dick scherrer wrote: |
Hello,
For only 1 user, this is a wasteful approach. For many users, this could have a larger negative affect on the system.
You might consider having the user submit whatever job(s) and at the end of each job, send an e-mail to the user with info from the job as well as the job number. We do this all of the time. |
Hi dick Ok..but I have to make the tool where users will select the job numbers.
Say if u enter 1 in the ISPF panel and press Enter , it will submit Job1. Then u press option C1 it will show the output of Job1 from JESYSMESG.Then u press Option2 it will Submit Job2 with the output file produced in Job1 .....and so on and so forth.
Any better ideas..@ dick scherrer |
Use a scheduler software, which is most likely installed at your site.
It does exactly what it says it does on the packet. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Why do you need the user to submit the next Job?
What are they looking at in the JESYSMESG that the process can not do itself?
Write a small Rexx/SDSF program to analyze the output and submit the next Job if acceptable.
You could even set a return code, and have the remaining functionality in the same Job execute based on the return code.
This is yet another case of the solution has been predetermined by the TS rather than stating the problem and getting expert advice on a workable solution.
I for one have written many user driven applications, and never once have I considered having the Rexx/ISPF application wait for a batch job to complete.
Anirban, I suggest you redesign your approach. Ignore good advice if you will. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Also, easily obtained in Assembler (R1 is used as an example only) -
Code: |
L R1,540 CURRENT 'TCB'
L R1,180(,R1) POINT TO 'JFCB'
L R1,316(,R1) POINT TO 'SSID'
LA R1,12(,R1) OK, WE'RE HERE
MVC JOBNBR,0(R1) POPULATE AS C'JOB00000'
|
With a little bit of ingenuity, you can can convert this to COBOL.
Mr. Bill |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
daveporcelan wrote: |
Why do you need the user to submit the next Job?
What are they looking at in the JESYSMESG that the process can not do itself?
Write a small Rexx/SDSF program to analyze the output and submit the next Job if acceptable.
You could even set a return code, and have the remaining functionality in the same Job execute based on the return code.
This is yet another case of the solution has been predetermined by the TS rather than stating the problem and getting expert advice on a workable solution.
I for one have written many user driven applications, and never once have I considered having the Rexx/ISPF application wait for a batch job to complete.
Anirban, I suggest you redesign your approach. Ignore good advice if you will. |
Thanks Dave. |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
Hi All,
I had a discussion with our team leadership and I presented the idea of alternative approaches which did include ideas presented by Bill,Dave,Nic,Expat,Dic and Akatsukami.
The constraint here is I am not supposed to modify any JCL as JCLs are
being written by developers and these run in productions.The automation that I am being asigned is mainly for non MF resources and clients who can atleast repeat the jobs using GUI Panels and the output would be visible to them.
sending mails - is not an option I have .
So they have instructed me to strictly follow the repeated step process.
The ultimate objective here is that users dont have to submit jobs using J or Sub ..they need not Go to ISPF and use ST and then ? under NP and review the output...Necessary outputs will be presented to them by the program on the screen after jobs finish executing.
If any Job abends,,,,then the Abend Code will be presented on the screen which they will convey to the developer. Even we are not supposed to
rectify it on our own no matter what level of expertise one has.
So under these circumstances ..what I have done so far is :
isfcols = "JNUM JOBID JNAME QUEUE"
K = Outtrap('m.')
"SUBMIT 'xxxxx.xxx.xxx(uuuu)'"
K = Outtrap('off')
Parse var m.1 v1 v2 v3 v4
now v3 = XXXXXXXX(JOB12345) so used Substr and obtained
my_jnum=Substr(v3,13,5)
then I used this job number as
do ix=1 to JNUM.0
if JNUM.ix=my_num then do
Address SDSF "ST TOKEN(’"TOKEN.ix"’) PARM(NP ?)" , "( prefix jds_"
/** here checking if nrc<>0 then exit 20 else---
do jx=1 to jds_DDNAME.0
if jds_DDNAME.jx = "JESYSMSG" then do
Address SDSF "ISFACT ST TOKEN(’"jds_TOKEN.jx"’)" , "PARM(NP SA)"
do kx=1 to isfddname.0
/*now using EXECIO and finding the output*/
I know that it may not be a good approach ..so now that O have stated my
restrictions..I implore our seniors ..please help with some ideas which u think will be more feasibile (actually wanted to say not lame and stupid as mine!) |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Did you happen to mention the problems if the initiators are full or stopped for some reason or when a users TSO session times out before the job finishes. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
if You had lurked a bit around You would have noticed that the general consensus is
against building Your own scheduler, and against having a tso user wait for a batch process to complete.
if Your organization is happy with it, just go ahead, but do not expect too much help from anybody around here! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I implore our seniors .. |
Why might you believe we would provide advice on something that most of us (seniors) believe should not be done.
Your management may expect you to do "something", but we would be somewhat irresponsible to help implement something that is known to cause more problems that it solves. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
See chapter 7, 'Reviewing execution of a job', of "Implementing REXX
Support in SDSF", SG24-7419-00
I think you can copy all of the examples in chapter 7 into one rexx program to do what you want (more or less). |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
Pedro wrote: |
See chapter 7, 'Reviewing execution of a job', of "Implementing REXX
Support in SDSF", SG24-7419-00
I think you can copy all of the examples in chapter 7 into one rexx program to do what you want (more or less). |
Thanks Pedro,,,,yeah..this book contains so many examples and covers almost everything I need.!! |
|
Back to top |
|
|
Anirban Bhattacharjee
New User
Joined: 12 Aug 2011 Posts: 9 Location: India
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
I implore our seniors .. |
Why might you believe we would provide advice on something that most of us (seniors) believe should not be done.
Your management may expect you to do "something", but we would be somewhat irresponsible to help implement something that is known to cause more problems that it solves. |
Ok Dic...yes bith u and enrico are correct.i agree.Just because i have been asked to be stupid doesnt mean I have to..gave it a lot of thought.
So I am starting over :
This is my requirement in brief :(repeating again for easy reference)
1) We have 4 Jobs.
2) First drains data from the queue .It takes no input and drains all the records from a queue without any filter and writes them to a current version of GDG.
3) In the next job..testers can input their uniqueue record identifier,say a serial number, and that filters the desired records only to another GDG.
Here every invidual testers will provide their own serial numbers and will get the desired records only as output .This job will search all the versions of GDG created by Step 2 for the record.
4)Output of 3rd job is input to Job 4.Job 4 creates 2 outputs(GDGs),one for archival and another for Printing in AFP printer.
My assignment is to create a panel based tool which will enable the non tech staffs to interact with the system.There shouldbe panel with minimum 100 coloumns for Step 2 where users will proide their identifiers
instead of them providing the same in SYSIN step.The tool will put their
identifiers from the panel in to the JCL and submit the job.
In all of the steps I need to show the output file names in a panel screen so that the users need not go to SDSF and find that out.
Also all the outputs of individual jobs needs to be displayed on the screen.
Now I dont have edit/copy/move and compile access to changeman..
so I have written a compile JCL and run JCl of my own and it works:)
I cant inform anybody through mail...all outputs must be captured in the tool screen itself.
Please advise what would be the best approach to achive this based upon your experience and observations .
If u just give me some basic ideas ..i would be ever grateful to you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Please advise what would be the best approach to achive this based upon your experience and observations . |
If i was required to do something similar, i would not have used this approach. . .
You/your organization has already decided steps that must be taken and now the goal is to try to find a way to implement so that the process can run end-to-end. I question the steps as defined. I suspect that "someone" has made this decision without thinking about the supportablilty of such a process. There are several "requirements" that i believe should be re-thought.
The amount of knowledge transfer that would be needed to address this here is too big for a forum topic. As a starting point, i would take the direction that the online and the batch do not need to "communicate". The results of the batch jobs can be made available by storing the data in user-specific files or database tables. Then using other screens, they can look at whatever without using SDSF. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
...by storing the data in user-specific viles... |
I know it is a typo, but what a great name that would be for a dataset containing "bad" (or "junk") data :-)
Serendipity stumbles upon us again. |
|
Back to top |
|
|
|