Does BPXWDYN solve the OP's problem?

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of John McKown
Sent: Wednesday, December 07, 2016 11:27 AM
To: [email protected]
Subject: Re: DDs in USS?

On Wed, Dec 7, 2016 at 11:29 AM, 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?
>
>
​What language is the program written in? Were you aware that with COBOL and 
PL/I, you can use UNIX environment variables to "allocate" a DD?
Suppose you have a COBOL program called BUBBA. It uses an SELECT similar to:

SELECT EXTRACT-DATA-FILE ASSIGN TO INDATA.

You can then write a script similar to:

#!/bin/sh
export INDATA="DSN($1) SHR" # DSN is passed on command line BUBBA

Invoke similar to: ./run-bubba INPUT.DATA.FILE In JCL, similar to //INDATA DD 
DISP=SHR,DSN=INPUT.DATA.FILE​

​The COBOL run time will see if there is a DD of INDATA. When there isn't, it 
checks the environment variable INDATA and sees it exists as
"DSN(INPUT.DATA.FILE) SHR" and does a dynamic allocation on the file. PL/I 
works similarly, but with slight differences in the environment variable name 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to