Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dynamic allocataion of file in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 4:12 pm    Post subject: Dynamic allocataion of file in COBOL
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Feb 09, 2010 4:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 09, 2010 4:36 pm    Post subject:
Reply with quote

I always felt comfortable with BPXWDYN over PUTENV.

Though you will get examples of both if you search forum
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 5:33 pm    Post subject: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem.

Thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 09, 2010 5:50 pm    Post subject: Re: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 09, 2010 5:53 pm    Post subject: Re: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

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 :

http://www.schlabb.de/resources/04009.pdf
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 6:53 pm    Post subject: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

oh no.. I am sorry.

Thanks Peter ;)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us