Here's a complete example. It is actually useful in some contexts.
$ echo " PUNCH TYPORG=PO" | ./iebptpch.rexx kirk.coz.sampjcl | sed 's/^.//'
/* REXX */
/**************************************************************
REXX shell script to invoke the z/OS IEBPTPCH utility
This script must be placed in the z/OS Unix file system,
as a file that is executable by the user:
chmod 755 iebptpch.rexx
DD:SYSIN - from stdin
DD:SYSUT1 - the fully qualified PDS (arg 1)
DD:SYSUT2 - to stdout
DD:SYSPRINT - DUMMY
*/
parse arg pds
urc = BPXWDYN("ALLOC DD(SYSUT1) DA('"pds"') SHR MSG(2) REUSE")
if urc <> 0 then
do
line.1 = "Error allocating input dataset"
address mvs "execio 1 diskw STDERR ( stem line."
exit 8
end
call BPXWDYN("ALLOC DD(SYSIN) PATH('/dev/fd0') PATHOPTS(ORDONLY)
FILEDATA(TEXT) MSG(2) REUSE")
#call BPXWDYN("ALLOC DD(SYSPRINT) PATH('/dev/fd2') PATHOPTS(OWRONLY)
FILEDATA(TEXT) MSG(2) REUSE")
call BPXWDYN("ALLOC DD(SYSPRINT) DUMMY MSG(2) REUSE")
call BPXWDYN("ALLOC DD(SYSUT2) PATH('/dev/fd1') PATHOPTS(OWRONLY)
FILEDATA(TEXT) MSG(2) REUSE")
address ATTCHMVS "IEBPTPCH"
urc=RC
call BPXWDYN("free DD(SYSIN) MSG(2)")
call BPXWDYN("free DD(SYSPRINT) MSG(2)")
call BPXWDYN("free DD(SYSUT1) MSG(2)")
call BPXWDYN("free DD(SYSUT2) MSG(2)")
exit urc
Kirk Wolf
Dovetailed Technologies
http://dovetail.com
On Wed, Dec 7, 2016 at 12:43 PM, Walt Farrell <[email protected]>
wrote:
> On Wed, 7 Dec 2016 12:29:33 -0500, Phil Smith III <[email protected]> wrote:
>
> >I have a program that normally runs from batch, but which I'd like to
> invoke
> >from USS. I can invoke it fine: the catch is that I need another DD
> defined.
> >Is there a way in a shell script or equivalent to do so?
>
> More details of your program might help. For example, it's probably more
> difficult, and would probably need a different approach, if it needs to run
> with APF authorization.
>
> --
> Walt
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN