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

Sending variables to JCL from a system command


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Thu Jan 21, 2010 8:59 pm
Reply with quote

Hello everybody icon_smile.gif

Here's a problem I couldn't find a solution for... I hope some of you know. icon_smile.gif

Is it possible to send extra information via the system command:
Code:
S JOB,D=<PDS_NAME>,N=<MEMBER_NAME>,...?


The idea is to send additional information to the job, which would then be used as a variable (&VAR, for example).

Is this possible?
If it is, please provide an example. icon_smile.gif
If the question is unclear, feel free to say so.

Cheers!
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: Thu Jan 21, 2010 9:04 pm
Reply with quote

This can be done for started tasks but I don't think it'll work for submitted jobs. Contact your site support group for assistance as started tasks are usually tightly controlled.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Thu Jan 21, 2010 10:07 pm
Reply with quote

Maybe a better solution could be found..

Let me describe the scenario briefly:
The idea is that a third-party software submits a system command which should result in sending an e-mail (which has some variable parts).
The idea above, is to send some parameters to a job and then use those parameters within the job to send a specific e-mail.

I believe this could be also done (amongst other ways) with a simple REXX program, but I don't know how to implement it.

Any help/example is very welcome. Thanks!
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jan 22, 2010 1:53 am
Reply with quote

Can you post the JCL in the started task "JOB" showing where you want to supply values?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jan 22, 2010 1:31 pm
Reply with quote

With the MVS MODIFY command parameters can be set.
The program in question has to have coding to facilitate this.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 2:26 pm
Reply with quote

Thanks for the response!

Here's the JCL that is ment to be used in the previously mentioned scenario...

Code:
//JOB CARD....
//**********************************************************
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2   DD SYSOUT=(B,SMTP)
//SYSUT1   DD *
helo MVSHOST
mail from:<host@company.org>
rcpt to:<receiver@company.org>
data
From:     host@company.org
To:       receiver@company.org
Subject:  Mail about &VAR1
This mail is about &VAR1. Please provide &VAR2.


2 variables are used above, &VAR1 and &VAR2.
The idea is to send those two variables to the job from a system command and submit the job.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 22, 2010 2:33 pm
Reply with quote

You cannot do it!
variable substitution takes place only on the jcl statements, not on the data statements
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 2:41 pm
Reply with quote

Ok.

Then maybe several "templates" could be used, and the parameter sent to the job would determine which data "template" would be used...?
(i.e. text of the mail would be constant, and system command parameter would determine which mail-template to use)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 22, 2010 2:48 pm
Reply with quote

Quote:
The idea is that a third-party software submits a system command

third party software, unless properly designed for system interaction should not submit system commands

more and more software interacting with the system is subject to close audit/scrutiny


You will have to write some code anyway,
simpler to submit a job!

if You organization is "securithy aware" there would be a concern also on the system security/integrity
granting an application the authority to issue console command is something
quite dangerous.
anything could be started....

as I said rather than using a start command, submit a jcl/job,
simpler, much more customizable, much more auditable from a security point of view!
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 2:54 pm
Reply with quote

If I understod right, you suggest that a job should be made for every scenario, and then just call an appropriate job?

In case1 - S JOB,D=MY.PDS,N=CASE1
In case2 - S JOB,D=MY.PDS,N=CASE2
...
?

Security is always something to look after for, so any suggestion in that direction is welcome, but in this case I think it's not a problem, since the place where the system commands are originating are secured/thrustworthy.
I can confirm that the third-party software in this case is properly configured and secured.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 22, 2010 2:57 pm
Reply with quote

Quote:
but in this case I think it's not a problem

what You think is irrelevant unless You have the authority to sign and file the document approving the solution You propose icon_biggrin.gif

it' is not a job issue, it is an approach issue.
the CONSOLE START COMMAND should not be considered a general user interface

do not use it, submit a job, maybe writing a REXX script to build the eMail content

... You will find very little help in using an approach that does not follow the common best business practices

using a start command to run a user application step is an example
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jan 22, 2010 3:03 pm
Reply with quote

S JOB,D=MY.PDS,N=CASE1 means starting a task, with parameters
for the task jcl.
As stated by Enrico :
variable substitution takes place only on the jcl statements, not on the data statements

If you want to change the behaviour of the started task you can do that
by means of the Modify command.

Since you are talking about a submitted job, the previous is beyond the scope of this thread.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 3:20 pm
Reply with quote

enrico-sorichetti wrote:
what You think is irrelevant unless You have the authority to sign and file the document approving the solution You propose icon_biggrin.gif
Thanks for the managment-guidelines icon_rolleyes.gif icon_biggrin.gif
But I'm in a need of a technical solution. icon_cool.gif

enrico-sorichetti wrote:
do not use it, submit a job, maybe writing a REXX script to build the eMail content
For reasons unknown to You, this is the only way in this case.
I would appriciate REXX script guidelines, but bare in mind that it should be initiated by a system command.

PeterHolland wrote:
If you want to change the behaviour of the started task you can do that by means of the Modify command.
Thanks for the hint Peter.
Could you please provide an example of your idea?
If this thread is inappropriate to discuss your idea, could you post it in the right one and we'll continue there?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 22, 2010 3:32 pm
Reply with quote

Quote:
but bare in mind that it should be initiated by a system command.


good luck !
if You had told from the beginning that the START command was the only accepted solution
I would not have wasted my time trying to give You proper advices on a less intrusive approach

Quote:
For reasons unknown to You, this is the only way in this case
.

when I get paid I can accept to do something because it is so even if I do not agree

when I do something on my time and at no charge I feel I am entitled to more respect and to be told why

when You ask for free consultancy telling the reason why You must adopt a solution is just a way of showing good manners and a thank You to the people willing to help you
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 3:40 pm
Reply with quote

enrico-sorichetti wrote:
if You had told from the beginning that the START command was the only accepted solution...
Not the START command, any system command... I'm sorry if I haven't made it clear in previous posts.

enrico-sorichetti wrote:
when I do something on my time and at no charge I feel I am entitled to more respect and to be told why
Fair enough! I hope You don't feel disrespected in this discussion, because it isn't so. And yes, thank You for your comments! icon_smile.gif
For security reasons I can't go in any further details on the "why" in this case. I'm sure You understand.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jan 22, 2010 4:05 pm
Reply with quote

As far as i see it im not sure that you (as a System Engineer?) know the difference between a submitted job or a started job (task) and how to use parameters in both cases.
So im afraid im not starting any thread to continue this matter,
maybe you do yourself some research on how to modify running tasks and/or releasing/submitting jobs programmatically.

Good luck.
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: Fri Jan 22, 2010 4:17 pm
Reply with quote

Based upon your comments, I think your only option is to contact the vendor of the third party software and discuss your requirements (in much more detail than you provided here) to see if they can be met. Since you are not giving us anywhere near enough information, we can provide, at best, only partial solutions based on what you've told us.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Jan 22, 2010 8:01 pm
Reply with quote

PeterHolland wrote:
As far as i see it im not sure that you (as a System Engineer?) know the difference between a submitted job or a started job (task) and how to use parameters in both cases.
I am rather new to the z-World, so please excuse my ignorance. I try to learn new things on the way.
I realized that the "JOB" in "S JOB..." is acctualy a procedure in PROCLIB, and that available parameters are D, N, LIST and CLASS...

So, I guess the real solution for my case is a REXX script which could be called from the system console and to which the parameters could be passed on...
I'll post a new thread in the REXX subforum next week, unless You think it's pointless.

Robert, Peter, Bill, Enrico, thank You.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 22, 2010 10:05 pm
Reply with quote

Hello,

Quote:
So, I guess the real solution for my case is a REXX script which could be called from the system console and to which the parameters could be passed on...
Suggest you ask if it is acceptable to use the system console for this type of activity. . .

It is not permitted on most systems. . .

The console is not for applicaton use.

Once you get clarificatoin from the vendor, the scheduling software may be able to help with your requirement.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top