Page 1 of 1

Using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 7:33 pm
by zxdalma
Hello

I have two questions on the issue of using BPXWDYN text interface to dynamic allocation services. The environment I’m currently using is a z/OS operating system and I call BPXWDYN through a COBOL program.

The questions are as follows:

• First of all imagine I use dynamic allocation to create a new dataset inside my COBOL program; after the dataset is created the COBOL program opens the dataset to populate it with data. Is it guaranteed that, meanwhile my program is running, no other program can access this dataset?.


• Related to the previous question, I see in the IBM Manual that there exists a HOLD keyword. May anyone explain in detail what is the purpose of this keyword. Moreover, if I try to use it I receive a 58720345 return code saying that I’m using mutually incompatible parameters.

The full invocation parameter is:

ALLOC DD(OTFILE) DSN(WNMT.SCADUC.XAPXAP.ZXDALMA) NEW CATALOG LRECL(80) RECFM(F,B) MSG(WTP) TRACKS SPACE(1000,500) BLKSIZE(27920) RELEASE HOLD

And the invocation is:

CALL BPXWDYN-PGM USING
BPXWDYN-PARM
RETURNING WS-DYN-RC
END-CALL.

Many thanks in advance

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 7:49 pm
by enrico-sorichetti
I see in the IBM Manual that there exists a HOLD keyword.

if You had kept reading the manual You would also have found the purpose of the keyword

May anyone explain in detail what is the purpose of this keyword.


for what reason should anybody rewrite the manual pages
( the explanation in the manual is detailed enough )

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 7:53 pm
by Robert Sample
For your first question, what did the manual tell you?

For your second question, from the manual:
Specifies that the output data set is to be held until released by the user or operator.
If you're reading enough of the manual to find the HOLD option, why did you not continue reading the manual to find out what it does? All the options are explained in the manual.

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 8:01 pm
by zxdalma
Hello,

Thanks for the reply; but about the reason code I receive when I'm using HOLD; I don't know which are the incompatible parameters; any suggestions?.

Kind regards

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 8:06 pm
by enrico-sorichetti
if You had read the flucking manual You would have seen

HOLD parameter

z/OS MVS JCL Reference
SA23-1385-00


Parameter type

Keyword, optional

Purpose

Use the HOLD parameter to tell the system to hold a sysout data set until it is released by the system operator. When the data set is ready for processing, notify the system operator to release it via a TSO/E NOTIFY parameter, a JES2 /*MESSAGE statement, or a JES3 //*OPERATOR statement.

A TSO/E user can specify HOLD=YES to retrieve a sysout data set and display it on a terminal. For JES3, the TSO/E user can process only work on the hold queue.
Note:
HOLD is supported only for sysout data sets. If HOLD appears on a DD statement that does not contain a SYSOUT parameter, it is ignored.
HOLD allows the sysout data set to be the internal reader. If the sysout data set is the internal reader, the job being submitted will be held.
In a JES2 system, SYSOUT held by specifying HOLD=YES may be selected via a SAPI (Sysout Application Process Interface) application. JES3 systems are not allowed to select the held SYSOUT via SAPI until the hold is released via operator command.

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 8:12 pm
by zxdalma
Understood,

Many thanks

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 10:26 pm
by expat
Alarm Bells ON

The dynamic allocation of datasets can be a major cause of headaches for the support people.
Unless you delete this dataset at end of program / job / abend you can cause problems for the people following you with the bucket and shovel

Please consider the use of dynamic datasets very very carefully

Re: Questions on using BPXWDYN interface from COBOL program

PostPosted: Thu Feb 15, 2018 10:52 pm
by zxdalma
Thanks expat;

I'd only do so in those very very rare cases where I'm forced to do allocation this way to meet special funcional requirements.

At our z/OS installation we allocate datasets in the usual way within JCL.

Regards