Alocating SYSOUT dynamically in COBOL.
Alocating SYSOUT dynamically in COBOL.
Hi,
Enterprise Cobol support dynamic allocation for files by using of an environment variable named with DDname and parameters for dataset for allocation. But if we try to allocate a SYSOUT, this raise an error IGZ0251W at run time. We can use BPXWDYN but can there be full COBOL approach for it?
Enterprise Cobol support dynamic allocation for files by using of an environment variable named with DDname and parameters for dataset for allocation. But if we try to allocate a SYSOUT, this raise an error IGZ0251W at run time. We can use BPXWDYN but can there be full COBOL approach for it?
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Alocating SYSOUT dynamically in COBOL.
Your post is unclear; are you attempting to allocate to DD name SYSOUT, or are you trying to allocate a SYSOUT=<something>? For the former, this quote from Enterprise COBOL V5.2 Programming Guide may be relevant:
[font=serif]Two files should not use the same ddname or environment variable name in their[/font]
[font=monospace]SELECT[/font][font=serif]clauses; otherwise, results could be unpredictable. For example, if[/font][font=monospace]DISPLAY[/font]
[font=serif]output is directed to[/font][font=monospace]SYSOUT[/font][font=serif], do not use[/font][font=monospace]SYSOUT[/font][font=serif]as the ddname or environment[/font]
[font=serif]variable name in the[/font][font=monospace]SELECT[/font][font=serif]clause for a file.[/font]
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Alocating SYSOUT dynamically in COBOL.
There was a recent Request For Enhancement (RFE) submitted to IBM to allow this. It was declined, although the decline messages refers to //SYSOUT DD ... not to //dddd DD SYSOUT=*.
Re: Alocating SYSOUT dynamically in COBOL.
I was asking for allocating the DD name SYSOUT.Robert Sample wrote:Your post is unclear; are you attempting to allocate to DD name SYSOUT, or are you trying to allocate a SYSOUT=<something>? For the former, this quote from Enterprise COBOL V5.2 Programming Guide may be relevant:[font=serif]Two files should not use the same ddname or environment variable name in their[/font]
[font=monospace]SELECT[/font][font=serif]clauses; otherwise, results could be unpredictable. For example, if[/font][font=monospace]DISPLAY[/font]
[font=serif]output is directed to[/font][font=monospace]SYSOUT[/font][font=serif], do not use[/font][font=monospace]SYSOUT[/font][font=serif]as the ddname or environment[/font]
[font=serif]variable name in the[/font][font=monospace]SELECT[/font][font=serif]clause for a file.[/font]
From the quote it means that we can not do that, is that right?
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Alocating SYSOUT dynamically in COBOL.
The quote is telling you that if you allocate SYSOUT DD name via a SELECT statement, you had better not have any DISPLAY statements in your program (not now nor ever in the future) or you will get unpredictable results.
Re: Alocating SYSOUT dynamically in COBOL.
But is not allocating SYSOUT using SELECT is different than allocating a DD name dynamically?
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Alocating SYSOUT dynamically in COBOL.
No! Dynamic allocation is still allocating a dataset to a DD name. You will get unpredictable results if you allocate to DD name SYSOUT no matter HOW you do the allocation.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute