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

Switch between environments


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

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Sat Jan 17, 2015 2:43 pm
Reply with quote

Hi All,

I am developing a tool to extract spool data every one hour.
I am using IKJEFT01 utility to run the rexx in JCL.

My shop has 5 regions namely rgc1,2,3,4,5
Now am submitting job 5 times for 5 environments

I want to run a single job with 5 steps with same rexx but passing a parm value of region where my rexx should run.


Is this achievable, if yes please teach me how to do.
If possible with code.

Thanks in advance. icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jan 17, 2015 8:58 pm
Reply with quote

Terminology is critical in IT, where similar terms may mean very different things. Your use of the term "region" is not a standard usage for that term -- do you mean LPAR? CICS region (the usual context for "region" in z/OS)? something else?

If these "regions" are actually LPARs, then what you want to do cannot be done -- a batch job runs in a single LPAR, period. You might be able to access the data via the spool API, but that would depend upon the spool package being used (among other details).

It sounds like you are attempting to write at least part of a job scheduler -- why not use the job scheduler already installed at your site instead of re-inventing the wheel? Such a task cannot be considered a good use of resources by your organization's management.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Sat Jan 17, 2015 9:26 pm
Reply with quote

Hi Robert,

Thanks for u reply and valuable comments.

In my project we use TWS as job schedular.
This needs a lot of approvals and formalities do be done.

Even chances for dropping the whole idea. So am using desktop schedular to run jobs in 1 hour interval.

And yes i mean LPAR'S.

I just thought of running a single job which internally triggers 4 other jobs one after another using JOBPARM SYSAFF=A.

But I am able to connect to 3 LPAR but other two are not getting connected.

I have LPAR A,B,C in which I can view A- job logs in B and vice versa. But from A am not able to view D&E.

Is there could be any reason.? Please teach me regarding LPAR settings.

Whole idea is to run a single script to get output's of all LPAR'S

Thanks in advance.

icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sun Jan 18, 2015 3:07 am
Reply with quote

An LPAR is a logical partition of a machine. Essentially, an LPAR is a virtual machine. The fact that you cannot see D & E from A probably indicates that A, B, C share resources while D & E do not share with these LPARs. Hence, it is not possible for you to accumulate data for D & E without running something on one of those LPARs; similarly, you can collect data from A, B, C -- so you MUST run a minimum of two jobs to collect the data you want.

We do not recommend on this forum that you develop your own job scheduler. They are complex pieces of code that frequently depend upon advanced knowledge of the operating system to accomplish their functions and hence rarely should be attempted by anyone without MANY years of z/OS experience. And most sites already have job schedulers so they consider an application programmer writing one to be a waste of time and resources.

No matter how difficult it is to set up your TWS, you would be VASTLY better off using it than trying to write your own scheduler.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Sun Jan 18, 2015 8:25 am
Reply with quote

Hi Robert,

Thanks a million for sharing the knowledge on LPARs.

Yes you are absolutely right on the schedular part.
I would have to make my code efficient enough to get an approval for TWS.
icon_smile.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Jan 19, 2015 10:20 pm
Reply with quote

Quote:
But from A am not able to view D&E.


You should use the JCL OUTPUT statement to get the job output back to A:
Code:
//X  OUTPUT DEST=RGCMVSA.BASHA,DEFAULT=YES


Another approach is to use FTP to submit the jobs and to retrieve the job output.
Code:
FTP RGCMVSD
SITE FILETYPE=JES
PUT filename.filetype

DIR will display the jobs.
GET will get the job output.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Wed Jan 21, 2015 9:51 am
Reply with quote

Hi Pedro,

I have used FTP concept to submit jobs.

I could successfully run job1 in LPAR1 from 4,

But when i run my rexx code its not working, i mean am getting error at
Code:
Address SDSF "isfexec st(ALTERNATE DELAYED"
if RC ª= 0 then do
say "isfexec RC" RC
exit


Am facing RC 8.

Complete code as below
Code:
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Trace "O"
Parse Source _sys _how _cmd .
parse arg args

IsfRC = isfcalls("ON")
if IsfRC ª= 0 then do
say "isfcalls RC" IsfRC
exit
end

isfprefix = "WR*"
isffilter = "queue = EXECUTION"
/*isfcols = "jname jobid ownerid actsys ISYSID"*/

Address SDSF "isfexec st"
if RC ª= 0 then do
say "isfexec RC" RC
exit
end

do i = 1 to jname.0
say jname.i jobid.i ownerid.i actsys.i jprio.i timee.i
end
call isfcalls "OFF"
exit
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jan 21, 2015 8:09 pm
Reply with quote

Let me recap the situation...
Quoting Robert Sample:
Quote:
The fact that you cannot see D & E from A probably indicates that A, B, C share resources while D & E do not share with these LPARs. Hence, it is not possible for you to accumulate data for D & E without running something on one of those LPARs;

Then I suggested you use OUTPUT statement or FTP to retrieve the job output.

Then you did not follow either of my suggestions, but tried something else.

SDSF does not work because you do not have access to that LPAR's spool.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Wed Jan 21, 2015 8:29 pm
Reply with quote

Hi Pedro,

I have used your technique of FTP ing,

Where am giving ip address of LPAR D and put command to sumbit job from LPAR A then as soon as get the maxcc of job i could able to view job log of LPAR D(ftp submitted) job in D spool itself.

To be precise Job is getting submitted in D(spool) from A using ftp but rexx part am getting rc8.

Is there any way that I can get jobs execution, job id, jname, start time using JCL itself without REXX. Something like PGM=SDSF to get only jobs in execution name id st-time.
I am not sure what parms to pass.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jan 21, 2015 10:57 pm
Reply with quote

Your JCL should have an OUTPUT statement so that the job output gets routed back to A when the job completes.

Earlier, I suggested this:
Code:
//X  OUTPUT DEST=RGCMVSA.BASHA,DEFAULT=YES

but you need to change to use the correct node name and userid.
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 Db2 SQL - how to switch among differe... DB2 18
No new posts Can rexx be exected in cics(online) e... All Other Mainframe Topics 3
No new posts Z/OS hosted on Linux (zDT) or zVM - T... All Other Mainframe Topics 0
No new posts How do i use the switch indicators fo... COBOL Programming 3
No new posts How to switch plans within a batch co... DB2 1
Search our Forums:

Back to Top