Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8201
Location: East Dubuque, Illinois, USA

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: 2445
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us