View previous topic :: View next topic
|
Author |
Message |
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Hello
I'm looking for a way to make a REXX program, which would take 2 variables (from a system command), and use them for sending an e-mail.
My current idea is to make REXX dynamically generate and submit a job (which contains another REXX for sending e-mails - XMITIP)
Better ideas are welcome.
Job template:
Code: |
//SEND EXEC PGM=IKJEFT1B,DYNAMNBR=200
//STEPLIB DD DISP=SHR,DSN=XMITIP.LOAD
//SYSEXEC DD DISP=SHR,DSN=XMITIP.EXEC
//SYSTCPD DD DISP=SHR,DSN=TCPIP.PARMLIB(TCPDATA)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
XMITIP (somemail@host.net) -
SUBJECT 'Test - &VAR1.' -
FROM zOS@host.net -
MSGT 'Test - &VAR2.'
|
I need help with the REXX code which would receive variables and use them to generate the JCL. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Ivan P wrote: |
I need help with the REXX code which would receive variables and use them to generate the JCL. |
OK, but you haven't provided any details for that code yet. What problem(s) are you encountering? What help do you need? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
What would your 'XMITIP' program do that the first rexx program cannot do? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
This seems to be a continuation of this topic:
www.ibmmainframes.com/viewtopic.php?t=46381
of which I admit I was pretty much lost towards the end. It almost seems as if the OP is referring to SysREXX, or a proprietary console automation product REXX, but I don't know. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
of which I admit I was pretty much lost towards the end |
Yup, methinks several of us are. . .
Possibly because the actual requirement has not yet been been posted, but rather multiple "solution attempts" that have problems have been posted.
It appears as with many of these topics, the TS has chosen the "solution" and is trying to make it fit the "requirement".
I also don't buy in to the concept that proper information cannot be posted due to "security". What ever the secure information, we don't need it. . . We do need proper information (substituted for the "secure" info) that properly describes the requirement. |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
superk wrote: |
of which I admit I was pretty much lost towards the end. |
Better don't take that topic into consideration here.
superk wrote: |
OK, but you haven't provided any details for that code yet. What problem(s) are you encountering? What help do you need? |
I thought someone would maybe post a "hello world" example which could be used in this case..
(or refer to a book with a "hello w." example)
Anyway, here's what I have so far..
Code: |
PARSE ARG var1 var2
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID()"
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('MY.DATASET')" STACK
"FREE FI(ISPFILE)"
"DEL 'TEMP.ISPFILE'"
"ALLOC FI(ISPFILE) DA('TEMP.ISPFILE') NEW TRACKS SPACE(10 10)
RECFM(F B) LRECL(80)"
"ISPEXEC FTOPEN"
"ISPEXEC FTINCL TEMPLATE"
"ISPEXEC FTCLOSE"
"SUBMIT 'TEMP.ISPFILE'"
"FREE FI(ISPFILE)"
"DEL 'TEMP.ISPFILE'"
EXIT |
Logic is pretty simple - use the template job to fill in the variables and submit it.. I need help with making the above code work.
MY.DATASET(TEMPLATE) - contains the template job posted earlier.
Pedro wrote: |
What would your 'XMITIP' program do that the first rexx program cannot do? |
Send an e-mail..
More on XMITIP - here.
dick scherrer wrote: |
We do need proper information (substituted for the "secure" info) that properly describes the requirement. |
Agreed.
Requirement behind this is simple - call a simple REXX program with a console command and send it 2 variables.
If this isn't possible or similar please correct me.
dick scherrer wrote: |
It appears as with many of these topics, the TS has chosen the "solution" and is trying to make it fit the "requirement".
|
Sorry, TS?
This is the best solution I can come up with at this moment. I'm sure there are far better solutions, but they're out of the scope of my knowledge now. I would gladly embrace them, but with a proper explanation.
I'm a newbie, so please bear with me. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
call a simple REXX program with a console command |
if the requirement isn' t a continuation of the other topic , then tell the difference!
Quote: |
Better don't take that topic into consideration here. |
so why do You resurrect the issue?
TS ==> Topic Starter
to make code work You need to tell what issues You have.
the request as posted has the same value as ... write the code for me!
as far as the hallo world here it is ...
Code: |
/* rexx */
say "Hallo world from Rexx!"
exit |
|
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
enrico-sorichetti wrote: |
if the requirement isn' t a continuation of the other topic , then tell the difference! |
Logical requirement is, implementation of it isn't.
It's a simple REXX script here, there was an attempt to do it with a job and starting a task..
It turned out that it's not possible that way:
enrico-sorichetti wrote: |
You cannot do it!
variable substitution takes place only on the jcl statements, not on the data statements |
Also...
enrico-sorichetti wrote: |
do not use it, submit a job, maybe writing a REXX script to build the eMail content |
Isn't a REXX script to build the e-mail content what this topic is about?
enrico-sorichetti wrote: |
to make code work You need to tell what issues You have.
the request as posted has the same value as ... write the code for me! |
The script is rather simple, I'm looking for comments/suggestions. I doubt it will work the way it is posted previously.
I'm not expecting that someone writes the code for me, but another example of a similar script would be very useful.
enrico-sorichetti wrote: |
as far as the hallo world here it is ... |
--> I'm under the impression You don't like when unexperienced people post/ask here.. Wouldn't it be simpler to make a sticky/rule/policy - "Post here only if you know: ........."?
It would keep the smile on Your and others faces... imho. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happened when You tried to run the rexx You posted ?
please tell, and we can start from there!
I did the searching on Your behalf, and here are some hints of file tailoring
ibmmainframes.com/viewtopic.php?t=25499
ibmmainframes.com/viewtopic.php?t=25810
ibmmainframes.com/viewtopic.php?t=42154
also a simple forum search with FTOPEN would have given lots of samples!
also here a different approach withou the need for the ispf environment
ibmmainframes.com/viewtopic.php?t=24978&highlight=rexx+queue
( my code snippet was TESTED )
by the way You remark is <choose a derogatory adjective of Your liking>
I have replied to lots of people withe less experience than Yours,
the only difference which made me willing to help was a much better attitude!
Yo asked for a hallo thing.. that what you got, no reason at all to complain!
if You/Your organization are not satisfied with the no charge consultancy You get here,
well... that's Your problem! |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Not sure why you want to do this with a batch job. Why not just call XMITIP directly from TSO? IKJEFT01 is TSO so if you are in TSO you are already running IKJEFT01. If you don't have XMITIP.LOAD in your load module search order then you can use LIBDEF ISPLLIB and call the command with an ISPEXEC SELECT CMD(...) ... command which will establish a tasklib environment so that the load module is found. if the EXEC is not in your SYSPROC or SYSEXEC dd names, you can call it with the EXEC command from TSO (there is no LIBDEF for SYSPROC or SYSEXEC, though there is an ALTLIB command in TSO - not recommended within ISPF though).See the ISPF books for details on LIBDEF and SELECT. |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
superk wrote: |
It almost seems as if the OP is referring to SysREXX, or a proprietary console automation product REXX, but I don't know. |
SysREXX was what I needed, but I wasn't aware of how it functions..
If someone is reading this with a similar problem and needs SysREXX:
* make sure there's an "AXR" started task
* place your REXX in (by default) SYS1.SAXREXEC
and then you can call your REXX with a system command:
F AXR,REXXNAME
enrico-sorichetti wrote: |
I did the searching on Your behalf, and here are some hints of file tailoring |
Thank You for searching on My behalf.
enrico-sorichetti wrote: |
I feel in a very very good mood today,
here is a WORKING and when I say WORKING it means that I have tested it,
solution ( just sketched ) |
This was nice of You in that topic. I wish You more very very good mood days.
enrico-sorichetti wrote: |
by the way You remark is <choose a derogatory adjective of Your liking>
I have replied to lots of people withe less experience than Yours,
the only difference which made me willing to help was a much better attitude! |
My remark wasn't written with degradation in mind, rather to remind you that this is only textual communication, where the other side can't detect emotions involved or a intention of sarcastic humour.
If You look at Your posts, objectly, they are far more derogatory to people You reply to, than my remark. |
|
Back to top |
|
|
|