View previous topic :: View next topic
|
Author |
Message |
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
I am trying to create a file dynamically from a COBOL program.
But the file is not getting allocated.
Could some one help me on this.
Code: |
FILE-CONTROL.
SELECT TEST-FILE ASSIGN TO DD1.
|
Code: |
DATA DIVISION.
FILE SECTION.
FD TEST-FILE
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS.
01 TEST-REC PIC X(80).
WORKING-STORAGE SECTION.
01 WS-DYNAMIC-OPEN-AREA.
05 FILE-NAME.
10 FILLER PIC X(35) VALUE
'DD1=DSN(TEST.PS.TESTFILE.OUT01) SHR'.
05 FILE-PTR POINTER.
05 RC PIC S9(9) BINARY VALUE ZERO.
|
Code: |
PROCEDURE DIVISION.
SET FILE-PTR TO ADDRESS OF FILE-NAME
CALL 'PUTENV' USING BY VALUE FILE-PTR RETURNING RC
IF RC NOT = 0
DISPLAY 'FILE PROBLEM'
END-IF
STOP RUN.
|
Please let me know if you need further details. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Search this forum -- there have been several discussions of COBOL dynamic allocation of files in the last year, including complete examples of code to do dynamic allocation. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
I always felt comfortable with BPXWDYN over PUTENV.
Though you will get examples of both if you search forum |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem.
Thanks. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Mathiv Anan wrote: |
An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem |
And a pointer to that article is that hard to provide? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
William Thompson wrote: |
Mathiv Anan wrote: |
An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem |
And a pointer to that article is that hard to provide? |
It probably is.
So to make new friends i will do that :
www.schlabb.de/resources/04009.pdf |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
oh no.. I am sorry.
Thanks Peter ;) |
|
Back to top |
|
|
|