Hi @Martin, there is no Ansible module dedicated to a WTO or WTOR, it was something we put on the books a few yrs ago that continued to get deprioritized over other features, we might be able to contain that in the coming year.
In my experience I have only ever performed a WTOR using the assembler macro and a few other low programming models, you should be able to do this with the ways you mentioned (JCL, REXX) and if in JCL you could also use the 'zos_mvs_raw' module.
If it were me, I would be thinking how to do this in a reusable fashion such that the message is a variable and then substitute that accordingly; for that you can use Ansible vars, and the dynamic medium can be :
1) Jinja templating either through zos_job_submit
(JCL) or zos_script
(REXX), use your var with the template
2) zos_mvs_raw
and use the var with the `dd_input` > `content` section
3) zos_copy
, inline some REXX/JCL with the `var` using the modules content option that can dynamically write to USS or a DataSet then follow up with execution which will var, eg if you write JCL into a data set or USS, follow up with zos_job_submit.
Another option is `AXRWTOR` which I believe came out in z/OS 2VR2, from this you could use the `zos_script` module + JINJA templating to create a reusable snippet (I took this from the operations guide: https://www.redbooks.ibm.com/redbooks/pdfs/sg248305.pdf) section 10.2.4.
Reply was a bit verbose, but hope it helps.
F AXR,SENDWTOR,T=0
/* REXX using WTOR */ 503
connect_id = "FIRSTLINE"; lines = Sourceline()
Do i=1 To lines; Call Axrmlwto Sourceline(i), "connect_id", "D"; End
Call AXRMlwto, "connect_id", "E"
Call AXRWtor "Reply to this message with any text."
Call AXRWto "Replied data is:" AxrReply /* Reply stored in AxrReply */
Exit
*017 Reply to this message with any text.
R 17,'This is an arbitrary text.'
IEE600I REPLY TO 017 IS;'This is an arbitrary text.'
Replied data is: This is an arbitrary text.
------------------------------
Demetri Dimatos
IBM zOS Ansible Core Senior Technical Lead
IBM
San Jose CA
------------------------------
Original Message:
Sent: Tue May 28, 2024 07:33 AM
From: Martin Weiß
Subject: Issue a WTOR in ansible playbook
Hi,
is there a ansible module I can use to issue a WTOR or can this only be done by sumitting a job or running a REXX script?
Kind regards
Martin
------------------------------
Martin Weiß
------------------------------