Using BPXWDYN interface from COBOL program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Using BPXWDYN interface from COBOL program

Postby zxdalma » Thu Feb 15, 2018 7:33 pm

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
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Questions on using BPXWDYN interface from COBOL program

Postby enrico-sorichetti » Thu Feb 15, 2018 7:49 pm

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 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Questions on using BPXWDYN interface from COBOL program

Postby Robert Sample » Thu Feb 15, 2018 7:53 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Questions on using BPXWDYN interface from COBOL program

Postby zxdalma » Thu Feb 15, 2018 8:01 pm

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
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Questions on using BPXWDYN interface from COBOL program

Postby enrico-sorichetti » Thu Feb 15, 2018 8:06 pm

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.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Questions on using BPXWDYN interface from COBOL program

Postby zxdalma » Thu Feb 15, 2018 8:12 pm

Understood,

Many thanks
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Questions on using BPXWDYN interface from COBOL program

Postby expat » Thu Feb 15, 2018 10:26 pm

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

These users thanked the author expat for the post:
zxdalma (Thu Feb 15, 2018 10:46 pm)
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Questions on using BPXWDYN interface from COBOL program

Postby zxdalma » Thu Feb 15, 2018 10:52 pm

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
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post